Namespace: Events

Phaser.Tweens. Events

Events


TIMELINE_COMPLETE

The Timeline Complete Event.

This event is dispatched by a Tween Timeline when it completes playback.

Listen to it from a Timeline instance using Timeline.on('complete', listener), i.e.:

var timeline = this.tweens.timeline({
    targets: image,
    ease: 'Power1',
    duration: 3000,
    tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ]
});
timeline.on('complete', listener);
timeline.play();
Parameters:
Name Type Description
timeline Phaser.Tweens.Timeline

A reference to the Timeline instance that emitted the event.

Source: src/tweens/events/TIMELINE_COMPLETE_EVENT.js (Line 7)

TIMELINE_LOOP

The Timeline Loop Event.

This event is dispatched by a Tween Timeline every time it loops.

Listen to it from a Timeline instance using Timeline.on('loop', listener), i.e.:

var timeline = this.tweens.timeline({
    targets: image,
    ease: 'Power1',
    duration: 3000,
    loop: 4,
    tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ]
});
timeline.on('loop', listener);
timeline.play();
Parameters:
Name Type Description
timeline Phaser.Tweens.Timeline

A reference to the Timeline instance that emitted the event.

loopCount integer

The number of loops left before this Timeline completes.

Source: src/tweens/events/TIMELINE_LOOP_EVENT.js (Line 7)

TIMELINE_PAUSE

The Timeline Pause Event.

This event is dispatched by a Tween Timeline when it is paused.

Listen to it from a Timeline instance using Timeline.on('pause', listener), i.e.:

var timeline = this.tweens.timeline({
    targets: image,
    ease: 'Power1',
    duration: 3000,
    tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ]
});
timeline.on('pause', listener);
// At some point later ...
timeline.pause();
Parameters:
Name Type Description
timeline Phaser.Tweens.Timeline

A reference to the Timeline instance that emitted the event.

Source: src/tweens/events/TIMELINE_PAUSE_EVENT.js (Line 7)

TIMELINE_RESUME

The Timeline Resume Event.

This event is dispatched by a Tween Timeline when it is resumed from a paused state.

Listen to it from a Timeline instance using Timeline.on('resume', listener), i.e.:

var timeline = this.tweens.timeline({
    targets: image,
    ease: 'Power1',
    duration: 3000,
    tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ]
});
timeline.on('resume', listener);
// At some point later ...
timeline.resume();
Parameters:
Name Type Description
timeline Phaser.Tweens.Timeline

A reference to the Timeline instance that emitted the event.

Source: src/tweens/events/TIMELINE_RESUME_EVENT.js (Line 7)

TIMELINE_START

The Timeline Start Event.

This event is dispatched by a Tween Timeline when it starts.

Listen to it from a Timeline instance using Timeline.on('start', listener), i.e.:

var timeline = this.tweens.timeline({
    targets: image,
    ease: 'Power1',
    duration: 3000,
    tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ]
});
timeline.on('start', listener);
timeline.play();
Parameters:
Name Type Description
timeline Phaser.Tweens.Timeline

A reference to the Timeline instance that emitted the event.

Source: src/tweens/events/TIMELINE_START_EVENT.js (Line 7)

TIMELINE_UPDATE

The Timeline Update Event.

This event is dispatched by a Tween Timeline every time it updates, which can happen a lot of times per second, so be careful about listening to this event unless you absolutely require it.

Listen to it from a Timeline instance using Timeline.on('update', listener), i.e.:

var timeline = this.tweens.timeline({
    targets: image,
    ease: 'Power1',
    duration: 3000,
    tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ]
});
timeline.on('update', listener);
timeline.play();
Parameters:
Name Type Description
timeline Phaser.Tweens.Timeline

A reference to the Timeline instance that emitted the event.

Source: src/tweens/events/TIMELINE_UPDATE_EVENT.js (Line 7)