springroll.DelayedCall Class
A class for delaying a call through the Application, instead of relying on setInterval() or
setTimeout().
Constructor
springroll.DelayedCall
(
-
callback
-
delay
-
[options=false]
-
[autoDestroy=true]
-
[useFrames=false]
)
Parameters:
-
callback
Function
The function to call when the delay has completed.
-
delay
Int
The time to delay the call, in milliseconds (or optionally frames).
-
[options=false]
Object | Boolean
optional
The options to use or repeat value
-
[repeat=false]
Boolean
optional
If the DelayedCall should automatically repeat itself when
completed.
-
[autoDestroy=true]
Boolean
optional
If the DelayedCall should clean itself up when completed.
-
[useFrames=false]
Boolean
optional
If the DelayedCall should use frames instead of
milliseconds for the delay.
-
[autoDestroy=true]
Boolean
optional
If the DelayedCall should clean itself up when completed.
-
[useFrames=false]
Boolean
optional
If the DelayedCall should use frames instead of
milliseconds for the delay.
_update
private
The callback supplied to the Application for an update each frame.
Parameters:
-
elapsed
Int
The time elapsed since the previous frame.
destroy
()
public
Stops and cleans up the DelayedCall. Do not use it after calling
destroy().
restart
()
public
Restarts the DelayedCall, whether it is running or not.
stop
()
public
Stops the DelayedCall, without destroying it.
_autoDestroy
Boolean
private
If the DelayedCall should destroy itself after completing
Default: true
_callback
Function
private
The function to call when the delay is completed.
_delay
Int
private
The delay time, in milliseconds.
_paused
Boolean
private
If the DelayedCall is currently paused (not stopped).
_repeat
Boolean
private
If the DelayedCall should repeat itself automatically.
Default: false
_timer
Int
private
The timer counting down from _delay, in milliseconds.
_useFrames
Boolean
private
If the DelayedCall should use frames instead of milliseconds for the delay.
Default: false
paused
Boolean
public
If the DelayedCall is paused or not.