new Ticker(start, opts)
Executes callback based on given fps and requestAnimationFrame
Parameters:
Name | Type | Argument | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
start |
Boolean |
<optional> |
Whether to start on instantiate. Default is true |
||||||||||||
opts |
Object |
<optional> |
Options Properties
|
Requires:
- module:Radio
Requires
- module:Radio
Methods
-
_update()
-
Calculates whether or not to call
Ticker#onTick
based onTicker#_fps
.
If the correct amount of time has passed theTicker#onTick
callback will fire and
thetick
event will be dispatched via thedocument
object. -
onPostTick(delta, ticks)
-
A callback executed post tick.
Parameters:
Name Type Description delta
Integer The time elapsed between ticks.
Multiply against gameplay elements for consistent
movement.ticks
Integer The amount of ticks that have accumulated
-
onPreTick(delta, ticks)
-
A callback executed pre each tick.
Parameters:
Name Type Description delta
Integer The time elapsed between ticks.
Multiply against gameplay elements for consistent
movement.ticks
Integer The amount of ticks that have accumulated
-
onTick(delta, ticks)
-
A callback executed on each tick.
Parameters:
Name Type Description delta
Integer The time elapsed between ticks.
Multiply against gameplay elements for consistent
movement.ticks
Integer The amount of ticks that have accumulated
-
start()
-
Starts the ticker