Constructor
new Ticker(Game, options)
Creates a ticker that updates Game every frame.
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Game | Game | Game ticker should be run on | ||||||||||||||||||||
options | Object | Options object Properties
|
- Source
Methods
start()
Starts a stopped ticker
- Source
stop()
Stops a running ticker. This will stop physics, performance, and animation updates, but will not stop the renderer.
- Source
on(event, callback)
Binds a function to an event
Name | Type | Description |
---|---|---|
event | "beforeTick" | | Name of the event |
callback | function | Function called when event fires |
- Source
off(event, callback)
Unbinds a function from an event
Name | Type | Description |
---|---|---|
event | "beforeTick" | | Name of the event |
callback | function | Function bound to event |
- Source
trigger(event)
Fires an event
Name | Type | Description |
---|---|---|
event | "beforeTick" | | Name of the event |
- Source