Class: TimerEvent

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.

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:
src/time/TimerEvent.js line 28

Members

args

Properties:
Name Type Description
arguments Array.<any>

Additional arguments to be passed to the callback.

Source:
src/time/TimerEvent.js line 70

callback : function

The callback that will be called when the TimerEvent occurs.

Type:
  • function
Source:
src/time/TimerEvent.js line 60

callbackContext : object

The context in which the callback will be called.

Type:
  • object
Source:
src/time/TimerEvent.js line 65

delay : number

The delay in ms at which this TimerEvent fires.

Type:
  • number
Source:
src/time/TimerEvent.js line 40

loop : boolean

True if this TimerEvent loops, otherwise false.

Type:
  • boolean
Source:
src/time/TimerEvent.js line 55

<protected> pendingDelete : boolean

A flag that controls if the TimerEvent is pending deletion.

Type:
  • boolean
Source:
src/time/TimerEvent.js line 76

repeatCount : number

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

Type:
  • number
Source:
src/time/TimerEvent.js line 50

tick : number

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

Type:
  • number
Source:
src/time/TimerEvent.js line 45

<protected, readonly> timer : Phaser.Timer

The Timer object that this TimerEvent belongs to.

Type:
Source:
src/time/TimerEvent.js line 35

phaser-ce@2.20.1 is on GitHub and NPM

Documentation generated by JSDoc 3.6.11 on 2024-10-05 using Tomorrow.