Difference between revisions of "Timer.delayedCall"

From GiderosMobile
(Created page with "__NOTOC__ '''Available since:''' Gideros 2011.6<br/> === Description === <br /> Provides a simple way to call a function after a set amount of time. This function returns the<...")
 
 
(12 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 
'''Available since:''' Gideros 2011.6<br/>
 
'''Available since:''' Gideros 2011.6<br/>
 +
'''Class:''' [[Timer]]<br/>
 +
 
=== Description ===
 
=== Description ===
<br />
+
Provides a simple way to call a function after a set amount of time. This function returns the '''Timer''' object created inside.
Provides a simple way to call a function after a set amount of time. This function returns the<br />
+
<syntaxhighlight lang="lua">
`Timer` object created inside.<br />
+
(Timer) = Timer.delayedCall(delay,func,data)
<br />
+
</syntaxhighlight>
<source lang="lua">
+
 
(Timer), = Timer.delayedCall(delayfuncdata,)
+
=== Parameters ===
</source>
+
'''delay''': (number) delay in miliseconds before the function is called<br/>
'''delay:''' (number) Delay in miliseconds before the function is called ''''''<br/>
+
'''func''': (function) function to call<br/>
'''func:''' (function) Function to call ''''''<br/>
+
'''data''': (any) an optional data parameter that is passed as a first argument to the function '''optional'''<br/>
'''data:''' (any) An optional data parameter that is passed as a first argument to the function '''optional'''<br/>
+
 
'''Returns''' (Timer) The `Timer` object<br/>
+
=== Return values ===
 +
'''Returns''' (Timer) the Timer object<br/>
 +
 
 +
{{Timer}}

Latest revision as of 22:37, 24 August 2024

Available since: Gideros 2011.6
Class: Timer

Description

Provides a simple way to call a function after a set amount of time. This function returns the Timer object created inside.

(Timer) = Timer.delayedCall(delay,func,data)

Parameters

delay: (number) delay in miliseconds before the function is called
func: (function) function to call
data: (any) an optional data parameter that is passed as a first argument to the function optional

Return values

Returns (Timer) the Timer object