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...
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...
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...
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 ...
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...
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...