Class: Phaser.TimerEvent
Constructor
new TimerEvent(timer, delay, tick, repeatCount, loop, callback, callbackContext, arguments)
A TimerEvent is a single event that is processed by a Phaser.Timer.
It consists of a delay, which is a value in milliseconds after which the event will fire.
When the event fires it calls a specific callback with the specified arguments.
TimerEvents are removed by their parent timer once finished firing or repeating.
Use Phaser.Timer#add, Phaser.Timer#repeat, or Phaser.Timer#loop methods to create a new event.
Parameters
Name | Type | Description |
---|---|---|
timer | Phaser.Timer | The Timer object that this TimerEvent belongs to. |
delay | number | The delay in ms at which this TimerEvent fires. |
tick | number | The tick is the next game clock time that this event will fire at. |
repeatCount | number | If this TimerEvent repeats it will do so this many times. |
loop | boolean | True if this TimerEvent loops, otherwise false. |
callback | function | The callback that will be called when the TimerEvent occurs. |
callbackContext | object | The context in which the callback will be called. |
arguments | Array.<any> | Additional arguments to be passed to the callback. |
- Source code: time/TimerEvent.js (Line 28)
Public Properties
- Source code: time/TimerEvent.js (Line 70)
- Source code: time/TimerEvent.js (Line 60)
- Source code: time/TimerEvent.js (Line 65)
- Source code: time/TimerEvent.js (Line 40)
- Source code: time/TimerEvent.js (Line 55)
- Internal:
- This member is internal (protected) and may be modified or removed in the future.
- Source code: time/TimerEvent.js (Line 76)
- Source code: time/TimerEvent.js (Line 50)
- Source code: time/TimerEvent.js (Line 45)
- Internal:
- This member is internal (protected) and may be modified or removed in the future.
- Source code: time/TimerEvent.js (Line 35)
args
Properties:
Name | Type | Description |
---|---|---|
arguments | Array.<any> | Additional arguments to be passed to the callback. |
callback : Function
The callback that will be called when the TimerEvent occurs.
callbackContext : Object
The context in which the callback will be called.
delay : number
The delay in ms at which this TimerEvent fires.
loop : boolean
True if this TimerEvent loops, otherwise false.
<internal> pendingDelete : boolean
A flag that controls if the TimerEvent is pending deletion.
repeatCount : number
If this TimerEvent repeats it will do so this many times.
tick : number
The tick is the next game clock time that this event will fire at.
<internal, readonly> timer : Phaser.Timer
The Timer object that this TimerEvent belongs to.
© 2016 Richard Davey, Photon Storm Ltd.
Licensed under the MIT License.
http://phaser.io/docs/2.6.2/Phaser.TimerEvent.html