loop(delay, callback, callbackContext, arguments) → {Phaser.TimerEvent}
Adds a new looped Event to this Timer that will repeat forever or until the Timer is stopped.
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 272)
Please login to continue.