Search found 7 matches

by CinderRose
Sun Mar 12, 2023 2:45 am
Forum: Support and Development
Topic: [SOLVED] Help with Replacing the alpha value of one texture with another.
Replies: 2
Views: 2221

Re: Help with Replacing the alpha value of one texture with another.

keharriso wrote: Sun Mar 12, 2023 2:14 am I think you're right about shaders being the way to go. Try this one:
Yo it works!
The syntax is a little confusing, but I think I understand how it works.

Much appreciated, thank you <3
by CinderRose
Sun Mar 12, 2023 12:33 am
Forum: Support and Development
Topic: [SOLVED] Help with Replacing the alpha value of one texture with another.
Replies: 2
Views: 2221

[SOLVED] Help with Replacing the alpha value of one texture with another.

I'm essentially trying to use an image as a stencil. I want to take a texture and replace the alpha value of every pixel with the the alpha value of a masking image. I tried https://love2d.org/wiki/love.graphics.stencil to some success, but the alpha is all or nothing and the edges of things look to...
by CinderRose
Tue Feb 07, 2017 11:05 am
Forum: Support and Development
Topic: [SOLVED] (Newbie) how to pass the position of a table's index instead of the index's value
Replies: 10
Views: 6531

Re: [SOLVED] (Newbie) how to pass the position of a table's index instead of the index's value

For future reference, your "a" is your field name. t.a equals to t["a"], and t.a = 1 means your field "a" carries 1 value. It's like t = {"a" = 1} So, naming variables and field names understandably is important. Since you're a newbie, once your code is thous...
by CinderRose
Tue Feb 07, 2017 9:27 am
Forum: Support and Development
Topic: [SOLVED] (Newbie) how to pass the position of a table's index instead of the index's value
Replies: 10
Views: 6531

Re: (Newbie) how to pass the position of table's index instead of the index's value

The problem is you are giving the value of "a" = 1 then passing an 'a' variable. You should pass it like this: test(n1, "a", 1) It works! I've been trying to figure out how to do this for... too long. Thank you so very much. Also, You can make a variable equal to "a" f...
by CinderRose
Tue Feb 07, 2017 9:03 am
Forum: Support and Development
Topic: [SOLVED] (Newbie) how to pass the position of a table's index instead of the index's value
Replies: 10
Views: 6531

Re: (Newbie) how to pass the position of table's index instead of the index's value

BTW, try to use more understandable variable names. Using n1 for a table, and n2 for a value will just make your code unreadable. I will try your code in a minute. I am terrible at coming up with variable names, but I try to balance that out by commenting the hell out of the code. Also, thanks for ...
by CinderRose
Tue Feb 07, 2017 8:41 am
Forum: Support and Development
Topic: [SOLVED] (Newbie) how to pass the position of a table's index instead of the index's value
Replies: 10
Views: 6531

Re: (Newbie) how to pass the position of table's index instead of the index's value

You can use n1[n2] I think. In Lua passing a variable to a table, is made like this, AFAIK. Error: Attempted to preform arithmetic on a nil value. I think it has the same problem where the code is looking for the index [n2] instead of the index [a] (which is supposed to be stored in the functions n...
by CinderRose
Tue Feb 07, 2017 8:05 am
Forum: Support and Development
Topic: [SOLVED] (Newbie) how to pass the position of a table's index instead of the index's value
Replies: 10
Views: 6531

[SOLVED] (Newbie) how to pass the position of a table's index instead of the index's value

I'm trying to make a function that will go to a specified table, look at a specified element of said table, and change that element in a specified way. t = {} --Here's a table. t.a = 1 -- The first index of the table is [a] and it has a value of [1]. -- I might be misunderstanding how to use this &q...