Event.TIMER: Difference between revisions

From GiderosMobile
No edit summary
No edit summary
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
'''Available since:''' Gideros 2011.6<br/>
'''<translate>Value</translate>:''' timer<br/>
'''Value:''' timer<br/>
'''<translate>Defined by</translate>:''' [[Special:MyLanguage/Timer|Timer]]<br/>
'''Defined by:''' [[Timer]]<br/>
=== <translate>Descriptio</translate>n ===
 
<translate>This event is dispatched on every `Timer` repeat until timer is stopped or the provided amount of repeat count is reached</translate>
=== Description ===
This event is dispatched on every Timer repeat until timer is stopped or the provided amount of repeat count is reached.
 
=== Example ===
<syntaxhighlight lang="lua">
local timer = Timer.new(1000, 2) -- timer will execute 2 times with 1000ms delay
timer:addEventListener(Event.TIMER, function()
print("timer count: "..timer:getCurrentCount())
end)
timer:start()
</syntaxhighlight>
 
{{Timer}}

Latest revision as of 00:45, 25 August 2024

Available since: Gideros 2011.6
Value: timer
Defined by: Timer

Description

This event is dispatched on every Timer repeat until timer is stopped or the provided amount of repeat count is reached.

Example

local timer = Timer.new(1000, 2) -- timer will execute 2 times with 1000ms delay
timer:addEventListener(Event.TIMER, function()
	print("timer count: "..timer:getCurrentCount())
end)
timer:start()