Timer#add()

add(delay, callback, callbackContext, arguments) → {Phaser.TimerEvent}

Adds a new Event to this Timer.

The event will fire after the given amount of delay in milliseconds has passed, once the Timer has started running.
The delay is in relation to when the Timer starts, not the time it was added. If the Timer is already running the delay will be calculated based on the timers current time.

Make sure to call start after adding all of the Events you require for this Timer.

Parameters
Name Type Argument Description
delay integer

The number of milliseconds, in game time, before the timer event occurs.

callback function

The callback that will be called when the timer event occurs.

callbackContext object

The context in which the callback will be called.

arguments * <repeatable>

Additional arguments that will be supplied to the callback.

Returns

The Phaser.TimerEvent object that was created.

Source code: time/Timer.js (Line 228)
doc_phaser
2017-02-14 11:18:08
Comments
Leave a Comment

Please login to continue.