Timer:pause
From GiderosMobile
Available since: Gideros 2011.6
Class: Timer
Description
Pauses the timer. <syntaxhighlight lang="lua"> Timer:pause() </source>
Example
<syntaxhighlight lang="lua"> local pix = Pixel.new(0x00FFaa, 1, 64, 64) pix:setAnchorPoint(0.5, 0.5) pix:setPosition(128, 128) stage:addChild(pix)
local timer = Timer.new(24, 360)
function onTimer(e) pix:setRotation(pix:getRotation() + 0.5) if pix:getRotation() > 90 then timer:pause() end end
timer:addEventListener(Event.TIMER, onTimer, timer) timer:start() </source>