Phaser API Documentation

  Version: 

Member of: Phaser.Time.Clock

addEvent(config)

Description:

Creates a Timer Event and adds it to the Clock at the start of the frame.

You can also pass in an existing Timer Event, which will be reset and added to this Clock.

Note that if the Timer Event is being used by another Clock (in another Scene) it will still be updated by that Clock as well, so be careful when using this feature.

Parameters:

name type description
config Phaser.Time.TimerEvent | Phaser.Types.Time.TimerEventConfig

The configuration for the Timer Event, or an existing Timer Event object.

Returns:
Description:

The Timer Event which was created, or passed in.

Since: 3.0.0
Source: src/time/Clock.js (Line 154)