Phaser API Documentation

  Version: 
This is a beta release of our new docs system. Found an issue?
Please tell us about it in the #📖-newdocs-feedback channel on the Phaser Discord
Event: TWEEN_UPDATE
Phaser.Tweens.Events.TWEEN_UPDATE
TWEEN_UPDATE

Description:

The Tween Update Event.

This event is dispatched by a Tween every time it updates any of the properties it is tweening.

A Tween that is changing 3 properties of a target will emit this event 3 times per change, once per property.

Note: This is a very high frequency event and may be dispatched multiple times, every single frame.

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

var tween = this.tweens.add({
    targets: image,
    x: 500,
    ease: 'Power1',
    duration: 3000,
});
tween.on('update', listener);

Parameters:

name type description
tween Phaser.Tweens.Tween

A reference to the Tween instance that emitted the event.

key string

The property that was updated, i.e. x or scale.

target any

The target object that was updated. Usually a Game Object, but can be of any type.

current number

The current value of the property that was tweened.

previous number

The previous value of the property that was tweened, prior to this update.

Since: 3.19.0