Hi I’ve been trying to figure how to do a timer that goes. I know how to up time but I want to down going form 60, 59, 58…
I’ve got the code for going up
local t = display.newText( “60”, 115, 105, “ArialRoundedMTBold”, 160 )
t:setTextColor( 0, 0, 0 )
local timeDelay = 500
local t = display.newText( “60”, 115, 105, “ArialRoundedMTBold”, 160 )
t:setTextColor( 0, 0, 0 )
function t:timer( event )
local count = event.count
self.text = count
if count >= 90 then
timer.cancel( event.source ) – after the 20th iteration, cancel timer
end
end
timer.performWithDelay( timeDelay, t, -1 )
I’ve got the timer going up but how would I make it go down.
[import]uid: 17058 topic_id: 19263 reply_id: 319263[/import]
[import]uid: 52491 topic_id: 19263 reply_id: 74347[/import]