Phaser: Request about Tween.getValue, Tween.updateTo and Tween data set current value

Created on 19 Aug 2019  路  2Comments  路  Source: photonstorm/phaser

I noticed a few odd things with the class Tween.

In function getValue() you cannot specify which property to obtain the value. It returns the value of the first item in the data array, Would it be possible to add a key parameter similar to updateTo() function?

The function updateTo() is a little unclear as of what is being updated. The documentation states

Updates the value of a property of this Tween to a new value, without adjusting the Tween duration or current progress.

You can optionally tell it to set the 'start' value to be the current value (before the change).

Current progress refers to the current value of the property being tweened (in tween data) and not to the member progress of the Tween Class. Would it be possible for the documentation to state it updates the tween data's end to make it clearer?

Similar to getValue() function, would it be possible to add a setValue() function to set the value current in the tween data?

Most helpful comment

I forgot that method even still existed. It is a left-over from Phaser 2. It's useless and should be removed! If you want a tween value you should obtain it via the config callbacks instead really.

All 2 comments

I forgot that method even still existed. It is a left-over from Phaser 2. It's useless and should be removed! If you want a tween value you should obtain it via the config callbacks instead really.

@photonstorm it being used by Phaser.GameObjects.PathFollower, so by removing that PathFollower won't work.
Throws an error tween.getValue is not a function

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Legomite picture Legomite  路  4Comments

lilijreey picture lilijreey  路  4Comments

SKEPDIMI picture SKEPDIMI  路  4Comments

samme picture samme  路  3Comments

samme picture samme  路  4Comments