Difference between revisions of "Timer"

From GiderosMobile
Line 7: Line 7:
 
through [[Event.TIMER]] and [[Event.TIMER_COMPLETE]] events.<br /></translate>
 
through [[Event.TIMER]] and [[Event.TIMER_COMPLETE]] events.<br /></translate>
 
{|-
 
{|-
| style="width: 50%;"|
+
| style="width: 50%; vertical-align:top;"|
 
=== Methods ===
 
=== Methods ===
[[Timer.delayedCall]] {{<translate>delayed call a function after a set amount of time</translate>}}<br/>
+
[[Timer.delayedCall]] ''<translate>delayed call a function after a set amount of time</translate>''<br/>
[[Timer.new]] {{<translate>creates a new Timer object</translate>}}<br/>
+
[[Timer.new]] ''<translate>creates a new Timer object</translate>''<br/>
[[Timer.pauseAll]] {{<translate>pause all timers</translate>}}<br/>
+
[[Timer.pauseAll]] ''<translate>pause all timers</translate>''<br/>
[[Timer.resumeAll]] {{<translate>resume all timers</translate>}}<br/>
+
[[Timer.resumeAll]] ''<translate>resume all timers</translate>''<br/>
[[Timer.stopAll]] {{<translate>stop all timers</translate>}}<br/>
+
[[Timer.stopAll]] ''<translate>stop all timers</translate>''<br/>
[[Timer:getCurrentCount]] {{<translate>returns the current trigger count of the timer</translate>}}<br/>
+
[[Timer:getCurrentCount]] ''<translate>returns the current trigger count of the timer</translate>''<br/>
[[Timer:getDelay]] {{<translate>returns the time interval between timer events in milliseconds</translate>}}<br/>
+
[[Timer:getDelay]] ''<translate>returns the time interval between timer events in milliseconds</translate>''<br/>
[[Timer:getRepeatCount]] {{<translate>returns the number of repetitions the timer will make</translate>}}<br/>
+
[[Timer:getRepeatCount]] ''<translate>returns the number of repetitions the timer will make</translate>''<br/>
[[Timer:isRunning]] {{<translate>returns the current running status of timer</translate>}}<br/>
+
[[Timer:isRunning]] ''<translate>returns the current running status of timer</translate>''<br/>
[[Timer:reset]] {{<translate>stops the timer and sets the currentCount property to 0</translate>}}<br/>
+
[[Timer:reset]] ''<translate>stops the timer and sets the currentCount property to 0</translate>''<br/>
[[Timer:setDelay]] {{<translate>sets the time interval between timer events in milliseconds</translate>}}<br/>
+
[[Timer:setDelay]] ''<translate>sets the time interval between timer events in milliseconds</translate>''<br/>
[[Timer:setRepeatCount]] {{<translate>sets the number of repetitions the timer will make</translate>}}<br/>
+
[[Timer:setRepeatCount]] ''<translate>sets the number of repetitions the timer will make</translate>''<br/>
[[Timer:start]] {{<translate>starts the timer</translate>}}<br/>
+
[[Timer:start]] ''<translate>starts the timer</translate>''<br/>
[[Timer:stop]] {{<translate>stops the timer</translate>}}<br/>
+
[[Timer:stop]] ''<translate>stops the timer</translate>''<br/>
| style="width: 50%;"|
+
| style="width: 50%; vertical-align:top;"|
 
=== Events ===
 
=== Events ===
 
[[Event.TIMER]]<br/>
 
[[Event.TIMER]]<br/>

Revision as of 14:35, 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.

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