This may sound stupid, but how do you use the timer in defold.
I am trying to make the sprite i have fade by ‘tinting’ it by 0.1 every 0.5 second.
local splash_timer = timer.delay(0.5, true, tint_background())
function tint_background(self, handle, time_elapsed)
local i = 1
if(i <= 10) then
go.set("#logo", "tint.w", (0.1*i))
i = i + 1
else
timer.cancel(handle)
end
end
The error message I keep getting is:
ERROR:SCRIPT: Unable to create a timer, the lua context does not have a timer world
I don’t get what I am doing wrong after reading Timer Reference.
Thanks for your help.