Phaser API Documentation

  Version: 

Member of: Phaser.Geom.Point

<static> Interpolate(pointA, pointB, [t], [out])

Description:

Returns the linear interpolation point between the two given points, based on t.

Parameters:

name type arguments description
pointA Phaser.Geom.Point

The starting Point for the interpolation.

pointB Phaser.Geom.Point

The target Point for the interpolation.

t number <optional>

The amount to interpolate between the two points. Generally, a value between 0 (returns the starting Point) and 1 (returns the target Point). If omitted, 0 is used.

out object | Phaser.Geom.Point <optional>

An optional Point object whose x and y values will be set to the result of the interpolation (can also be any object with x and y properties). If omitted, a new Point created and returned.

Returns:
Description:

Either the object from the out argument with the properties x and y set to the result of the interpolation or a newly created Point object.

Type:
Since: 3.0.0