Phaser API Documentation

  Version: 

Member of: Phaser.Math

<static> LinearXY(vector1, vector2, [t])

Description:

Interpolates two given Vectors and returns a new Vector between them.

Does not modify either of the passed Vectors.

Parameters:

name type arguments description
vector1 Phaser.Math.Vector2

Starting vector

vector2 Phaser.Math.Vector2

Ending vector

t number <optional>

The percentage between vector1 and vector2 to return, represented as a number between 0 and 1.

Returns:
Description:

The step t% of the way between vector1 and vector2.

Since: 3.60.0
Source: src/math/LinearXY.js (Line 7)