Difference between revisions of "Timer"

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

Revision as of 15:32, 13 September 2018


Supported platforms: Platform android.pngPlatform ios.pngPlatform mac.pngPlatform pc.pngPlatform html5.pngPlatform winrt.pngPlatform win32.png
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