Difference between revisions of "Timer"

From GiderosMobile
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
'''Supported platforms:''' android, ios, mac, pc<br/>
+
'''<translate>Supported platforms</translate>:''' [[File:Platform android]][[File:Platform ios]][[File:Platform mac]][[File:Platform pc]]<br/>
'''Available since:''' Gideros 2011.6<br/>
+
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
 +
'''<translate>Inherits from</translate>:''' [[Special:MyLanguage/Object|Object]]<br/>
 
=== <translate>Description</translate> ===
 
=== <translate>Description</translate> ===
 
<translate><br />
 
<translate><br />
The [[Special:MyLanguage/Timer|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 [[Special:MyLanguage/Event.TIMER|Event.TIMER]] and [[Special:MyLanguage/Event.TIMER_COMPLETE|Event.TIMER_COMPLETE]] events.<br /></translate>
+
through `Event.TIMER` and `Event.TIMER_COMPLETE` events.<br /></translate>
 
{|-
 
{|-
 
| style="width: 50%; vertical-align:top;"|
 
| style="width: 50%; vertical-align:top;"|

Revision as of 09:28, 24 August 2018

Supported platforms: File:Platform androidFile:Platform iosFile:Platform macFile:Platform pc
Available since: Gideros 2011.6
Inherits from: Object

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.

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

Events

Event.TIMER
Event.TIMER_COMPLETE

Constants