Navigation
These archived docs are for Phaser 2.4.8 Phaser 3 docs can be found on newdocs.phaser.io.
Phaser CE docs can be found on the Phaser CE Documentation site.

Constructor

Phaser. TimerEvent

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.

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 26)

Public Properties

args

Properties:
Name Type Description
arguments Array.<any>

Additional arguments to be passed to the callback.

Source code: time/TimerEvent.js (Line 68)

callback : Function

The callback that will be called when the TimerEvent occurs.

Source code: time/TimerEvent.js (Line 58)

callbackContext : Object

The context in which the callback will be called.

Source code: time/TimerEvent.js (Line 63)

delay : number

The delay in ms at which this TimerEvent fires.

Source code: time/TimerEvent.js (Line 38)

loop : boolean

True if this TimerEvent loops, otherwise false.

Source code: time/TimerEvent.js (Line 53)

<internal> pendingDelete : boolean

A flag that controls if the TimerEvent is pending deletion.

Internal:
  • This member is internal (protected) and may be modified or removed in the future.
Source code: time/TimerEvent.js (Line 74)

repeatCount : number

If this TimerEvent repeats it will do so this many times.

Source code: time/TimerEvent.js (Line 48)

tick : number

The tick is the next game clock time that this event will fire at.

Source code: time/TimerEvent.js (Line 43)

<internal, readonly> timer : Phaser.Timer

The Timer object that this TimerEvent belongs to.

Internal:
  • This member is internal (protected) and may be modified or removed in the future.
Source code: time/TimerEvent.js (Line 33)