Trouble using stencil()
Posted: Sun Dec 11, 2022 1:45 pm
Hi there,
I'm trying to use love.graphics.stencil(), but am having trouble trying to get it to do exactly what I want.
I'm able to successfully use the function like this
However, I want to be able to pass arguments into stencilFunction(), like this
Which gives me this error
Anyone know what I'm doing wrong? I'm guessing I'm misunderstanding how lua works in regards to passing functions.
I'm trying to use love.graphics.stencil(), but am having trouble trying to get it to do exactly what I want.
I'm able to successfully use the function like this
Code: Select all
love.graphics.stencil(stencilFunction, "replace", 1)
Code: Select all
love.graphics.stencil(stencilFunction(exampleArg), "replace", 1)
Code: Select all
bad argument #1 to 'stencil' (function expected, got nil)