Phaser API Documentation

  Version: 
Filter
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
Namespace: Interpolation
Phaser.Math.Interpolation

Methods

<static> Bezier(v, k)
Focus
Focus

Description:

A bezier interpolation method.

Parameters:

name type description
v Array.<number>

The input array of values to interpolate between.

k number

The percentage of interpolation, between 0 and 1.

Returns:
Description:

The interpolated value.

Type:
  • number
Examples:
Since: 3.0.0
Focus
Focus
<static> CatmullRom(v, k)
Focus
Focus

Description:

A Catmull-Rom interpolation method.

Parameters:

name type description
v Array.<number>

The input array of values to interpolate between.

k number

The percentage of interpolation, between 0 and 1.

Returns:
Description:

The interpolated value.

Type:
  • number
Examples:
Focus
Focus
<static> CubicBezier(t, p0, p1, p2, p3)
Focus
Focus

Description:

A cubic bezier interpolation method.

https://medium.com/@adrian_cooney/bezier-interpolation-13b68563313a

Parameters:

name type description
t number

The percentage of interpolation, between 0 and 1.

p0 number

The start point.

p1 number

The first control point.

p2 number

The second control point.

p3 number

The end point.

Returns:
Description:

The interpolated value.

Type:
  • number
Examples:
Focus
Focus
<static> Linear(v, k)
Focus
Focus

Description:

A linear interpolation method.

Parameters:

name type description
v Array.<number>

The input array of values to interpolate between.

k number

The percentage of interpolation, between 0 and 1.

Returns:
Description:

The interpolated value.

Type:
  • number
Examples:
Since: 3.0.0
Focus
Focus
<static> QuadraticBezier(t, p0, p1, p2)
Focus
Focus

Description:

A quadratic bezier interpolation method.

Parameters:

name type description
t number

The percentage of interpolation, between 0 and 1.

p0 number

The start point.

p1 number

The control point.

p2 number

The end point.

Returns:
Description:

The interpolated value.

Type:
  • number
Examples:
Focus
Focus
<static> SmootherStep(t, min, max)
Focus
Focus

Description:

A Smoother Step interpolation method.

Parameters:

name type description
t number

The percentage of interpolation, between 0 and 1.

min number

The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'.

max number

The maximum value, also known as the 'right edge', assumed greater than the 'left edge'.

Returns:
Description:

The interpolated value.

Type:
  • number
Examples:
Focus
Focus
<static> SmoothStep(t, min, max)
Focus
Focus

Description:

A Smooth Step interpolation method.

Parameters:

name type description
t number

The percentage of interpolation, between 0 and 1.

min number

The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'.

max number

The maximum value, also known as the 'right edge', assumed greater than the 'left edge'.

Returns:
Description:

The interpolated value.

Type:
  • number
Examples:
Focus
Focus