Tween#interpolation()

interpolation(interpolation, context, index) → {Phaser.Tween}

Sets the interpolation function the tween will use. By default it uses Phaser.Math.linearInterpolation.
Also available: Phaser.Math.bezierInterpolation and Phaser.Math.catmullRomInterpolation.
The interpolation function is only used if the target properties is an array.
If you have child tweens and pass -1 as the index value and it will set the interpolation function across all of them.

Parameters
Name Type Argument Default Description
interpolation function

The interpolation function to use (Phaser.Math.linearInterpolation by default)

context object <optional>

The context under which the interpolation function will be run.

index number <optional>
0

If this tween has more than one child this allows you to target a specific child. If set to -1 it will set the interpolation function on all children.

Returns

This tween. Useful for method chaining.

Source code: tween/Tween.js (Line 526)
doc_phaser
2017-02-14 11:18:33
Comments
Leave a Comment

Please login to continue.