Skip to main content
Version: Phaser v4.0.0-rc.6

Types.Time

TimelineEvent

<static> TimelineEvent

nametypeoptionaldefaultdescription
completebooleanNoHas this event completed yet?
oncebooleanNoIs this a once only event?
timenumberNoThe time (in elapsed ms) at which this event will fire.
repeatfunctionYes0The amount of times this Event has repeated.
iffunctionYesnullUser-land callback which will be called if set. If it returns true then this event run all of its actions, otherwise it will be skipped.
runfunctionYesnullUser-land callback which will be called when the Event fires.
loopfunctionYesnullUser-land callback which will be called when the Event loops.
tweenPhaser.Types.Tweens.TweenBuilderConfig | Phaser.Types.Tweens.TweenChainBuilderConfigPhaser.Tweens.TweenPhaser.Tweens.TweenChainYes
setobjectYesnullObject containing properties to set on the target when the Event fires if set.
soundstring | objectYesnullSound configuration object which will be used to create a Sound when the Event fires if set.
target*YesThe scope (this object) with which to invoke the run callback.
eventstringYesOptional event name to emit when the Event fires.
tweenInstancePhaser.Tweens.Tween | Phaser.Tweens.TweenChainYesnullIf this Event is using a Tween to manage its actions, this property will contain a reference to it.

Type: object

Member of: Phaser.Types.Time

Source: src/time/typedefs/TimelineEvent.js#L1
Since: 3.60.0


TimelineEventConfig

<static> TimelineEventConfig

nametypeoptionaldefaultdescription
atnumberYes0The time (in ms) at which the Event will fire. The Timeline starts at 0.
innumberYesIf the Timeline is running, this is the time (in ms) at which the Event will fire based on its current elapsed value. If set it will override the at property.
fromnumberYesFire this event 'from' milliseconds after the previous event in the Timeline. If set it will override the at and in properties.
runfunctionYesA function which will be called when the Event fires.
loopfunctionYesA function which will be called when the Event loops, this does not get called if the repeat method is not used or on first iteration.
eventstringYesOptional string-based event name to emit when the Event fires. The event is emitted from the Timeline instance.
target*YesThe scope (this object) with which to invoke the run callback, if set.
oncebooleanYesfalseIf set, the Event will be removed from the Timeline when it fires.
stopbooleanYesfalseIf set, the Timeline will stop and enter a complete state when this Event fires, even if there are other events after it.
tweenPhaser.Types.Tweens.TweenBuilderConfig | Phaser.Types.Tweens.TweenChainBuilderConfigPhaser.Tweens.TweenPhaser.Tweens.TweenChainYes
setobjectYesA key-value object of properties to set on the target when the Event fires. Ignored if no target is given.
soundstring | objectYesA 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

Member of: Phaser.Types.Time

Source: src/time/typedefs/TimelineEventConfig.js#L1
Since: 3.60.0


TimerEventConfig

<static> TimerEventConfig

nametypeoptionaldefaultdescription
delaynumberYes0The delay after which the Timer Event should fire, in milliseconds.
repeatnumberYes0The total number of times the Timer Event will repeat before finishing.
loopbooleanYesfalsetrue if the Timer Event should repeat indefinitely.
callbackfunctionYesThe callback which will be called when the Timer Event fires.
callbackScope*YesThe scope (this object) with which to invoke the callback. The default is the Timer Event.
argsArray.<*>YesAdditional arguments to be passed to the callback.
timeScalenumberYes1The scale of the elapsed time.
startAtnumberYes0The initial elapsed time in milliseconds. Useful if you want a long duration with repeat, but for the first loop to fire quickly.
pausedbooleanYesfalsetrue if the Timer Event should be paused.

Type: object

Member of: Phaser.Types.Time

Source: src/time/typedefs/TimerEventConfig.js#L1
Since: 3.0.0