Phaser API Documentation

  Version: 
Filter
Namespace: Time
Phaser.Types.Time
Source: src/time/typedefs/index.js (Line 7)

Type Definitions

TimelineEvent
Focus
Focus
Properties:
name type arguments Default description
complete boolean

Has this event completed yet?

once boolean

Is this a once only event?

time number

The time (in elapsed ms) at which this event will fire.

run function <optional> null

User-land callback which will be called when the Event fires if set.

tween Phaser.Tweens.Tween | Phaser.Tweens.TweenChain | Phaser.Types.Tweens.TweenBuilderConfig | Phaser.Types.Tweens.TweenChainBuilderConfig <optional> null

Tween configuration object which will be used to create a Tween when the Event fires if set.

set object <optional> null

Object containing properties to set on the target when the Event fires if set.

sound string | object <optional> null

Sound configuration object which will be used to create a Sound when the Event fires if set.

target * <optional>

The scope (this object) with which to invoke the run callback.

event string <optional>

Optional event name to emit when the Event fires.

Type:
object
Since: 3.60.0
Focus
Focus
TimelineEventConfig
Focus
Focus
Properties:
name type arguments Default description
at number <optional> 0

The time (in ms) at which the Event will fire. The Timeline starts at 0.

in number <optional>

If the Timeline is already running, this is the time (in ms) at which the Event will fire based on its current elapsed value. If set, overrides the at property.

from number <optional>

Fire this event 'from' milliseconds after the previous event in the Timeline. If set it overrides the at and in properties.

run function <optional>

A function which will be called when the Event fires.

event string <optional>

Optional string-based event name to emit when the Event fires. The event is emitted from the Timeline instance.

target * <optional>

The scope (this object) with which to invoke the run callback, if set.

once boolean <optional> false

If set, the Event will be removed from the Timeline when it fires.

stop boolean <optional> false

If set, the Timeline will stop and enter a complete state when this Event fires, even if there are other events after it.

tween Phaser.Tweens.Tween | Phaser.Tweens.TweenChain | Phaser.Types.Tweens.TweenBuilderConfig | Phaser.Types.Tweens.TweenChainBuilderConfig <optional>

A Tween or TweenChain configuration object or instance. If set, the Event will create this Tween when it fires.

set object <optional>

A key-value object of properties to set on the target when the Event fires. Ignored if no target is given.

sound string | object <optional>

A key from the Sound Manager to play, or a config object for a sound to play when the Event fires. If a config object it must provide two properties: key and config. The key is the key of the sound to play, and the config is the config is a Phaser.Types.Sound.SoundConfig object.

Type:
object
Since: 3.60.0
Focus
Focus
TimerEventConfig
Focus
Focus
Properties:
name type arguments Default description
delay number <optional> 0

The delay after which the Timer Event should fire, in milliseconds.

repeat number <optional> 0

The total number of times the Timer Event will repeat before finishing.

loop boolean <optional> false

true if the Timer Event should repeat indefinitely.

callback function <optional>

The callback which will be called when the Timer Event fires.

callbackScope * <optional>

The scope (this object) with which to invoke the callback. The default is the Timer Event.

args Array.<*> <optional>

Additional arguments to be passed to the callback.

timeScale number <optional> 1

The scale of the elapsed time.

startAt number <optional> 0

The initial elapsed time in milliseconds. Useful if you want a long duration with repeat, but for the first loop to fire quickly.

paused boolean <optional> false

true if the Timer Event should be paused.

Type:
object
Since: 3.0.0
Focus
Focus