Difference between revisions of "Timer"

From GiderosMobile
Line 5: Line 5:
 
<br />
 
<br />
 
The `Timer` class is used to execute a code at specified intervals. The listener functions are registered<br />
 
The `Timer` class is used to execute a code at specified intervals. The listener functions are registered<br />
through `Event.TIMER` and `Event.TIMER_COMPLETE` events.<br />
+
through `Event.TIMER` and `Event.TIMER_COMPLETE` events.<br />{|-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
{|-
 
 
| style="width: 50%;"|
 
| style="width: 50%;"|
 
=== Methods ===
 
=== Methods ===
Line 45: Line 24:
 
| style="width: 50%;"|
 
| style="width: 50%;"|
 
=== Events ===
 
=== Events ===
[[Event.TIMER]]
+
[[Event.TIMER]]<br/>
[[Event.TIMER_COMPLETE]]
+
[[Event.TIMER_COMPLETE]]<br/>
 
=== Constants ===
 
=== Constants ===
 
|}
 
|}

Revision as of 09:12, 23 August 2018

Supported platforms: android, ios, mac, pc
Available since: Gideros 2011.6

Description


The `Timer` class is used to execute a code at specified intervals. The listener functions are registered
through `Event.TIMER` and `Event.TIMER_COMPLETE` events.
{|- | style="width: 50%;"|

Methods

Timer.delayedCall - delayed call a function after a set amount of time
Timer.new - creates a new Timer object
Timer.pauseAll - pause all timers
Timer.resumeAll - resume all timers
Timer.stopAll - stop all timers
Timer:getCurrentCount - returns the current trigger count of the timer
Timer:getDelay - returns the time interval between timer events in milliseconds
Timer:getRepeatCount - returns the number of repetitions the timer will make
Timer:isRunning - returns the current running status of timer
Timer:reset - stops the timer and sets the currentCount property to 0
Timer:setDelay - sets the time interval between timer events in milliseconds
Timer:setRepeatCount - sets the number of repetitions the timer will make
Timer:start - starts the timer
Timer:stop - stops the timer
| style="width: 50%;"|

Events

Event.TIMER
Event.TIMER_COMPLETE

Constants

|}