Is there really no way to pass arguments through :addEventListener() to the function you call?
I know I can add a custom property but I am just curious.
Is there really no way to pass arguments through :addEventListener() to the function you call?
I know I can add a custom property but I am just curious.
What are you specifically trying to accomplish?
You could always dispatch an event, but I don’t think you can pass arguments to the function at the time you add the listener.
I mean my examples are too complex so i’ll just create a simple one.
button:addEventListener("tap", myFunc(5))
local function myFunc(num)
num = num/2
end
oh thanks. Solved.