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#onTickbased onTicker#_fps.
If the correct amount of time has passed theTicker#onTickcallback will fire and
thetickevent will be dispatched via thedocumentobject. -
onPostTick(delta, ticks)
-
A callback executed post tick.
Parameters:
Name Type Description deltaInteger The time elapsed between ticks.
Multiply against gameplay elements for consistent
movement.ticksInteger The amount of ticks that have accumulated
-
onPreTick(delta, ticks)
-
A callback executed pre each tick.
Parameters:
Name Type Description deltaInteger The time elapsed between ticks.
Multiply against gameplay elements for consistent
movement.ticksInteger The amount of ticks that have accumulated
-
onTick(delta, ticks)
-
A callback executed on each tick.
Parameters:
Name Type Description deltaInteger The time elapsed between ticks.
Multiply against gameplay elements for consistent
movement.ticksInteger The amount of ticks that have accumulated
-
start()
-
Starts the ticker