These docs are for Phaser 2.6.2 Phaser 3 docs can be found on GitHub pages.
Phaser CE docs can be found on the Phaser CE Documentation site.

Constructor

Phaser. PathPoint

new PathPoint(x, y, vx, vy, speed, data, branchPath, branchPointIndex)

The PathPoint class contains data and functions for each point on a Path.

Parameters
Name Type Argument Default Description
x number

The x coordinate of the PathPoint.

y number

The y coordinate of the PathPoint.

vx number

The x coordinate of the tangent vector to create the curve from.

vy number

The y coordinate of the tangent vector to create the curve from.

speed number <optional>
1

The speed multiplier for PathFollowers on this Path segment.

data object <optional>

The data associated with this point, e.g.: { type: PathPoint.DATA_VALUE, value: XXX }

branchPath Phaser.Path <optional>

A branched path which is attached to this point.

branchPointIndex number <optional>

The index where the branch is attached to on the new path.

Source code: plugins/path/PathPoint.js (Line 22)

Public Properties

[static] DATA_COUNTER : number

Source code: plugins/path/PathPoint.js (Line 118)

[static] DATA_NONE : number

Source code: plugins/path/PathPoint.js (Line 100)

[static] DATA_PAUSE : number

Source code: plugins/path/PathPoint.js (Line 106)

[static] DATA_VALUE : number

Source code: plugins/path/PathPoint.js (Line 112)

active : boolean

Is this point a selected (or active) point?

Source code: plugins/path/PathPoint.js (Line 84)

branchPath : Phaser.Path

A branched path which is attached at this point.

Source code: plugins/path/PathPoint.js (Line 62)

branchPointIndex : number

The index where the branch is attached to on the new path.

Source code: plugins/path/PathPoint.js (Line 67)

branchType : number

The branch type of the path this point is on. Either 0 (attached) or 1 (joined)

Source code: plugins/path/PathPoint.js (Line 72)

controlPoints :array

A list of Phaser.Point objects representing the control points on the segment.

Source code: plugins/path/PathPoint.js (Line 90)

<internal> curve : number

Once the Hermite curve is calculated, store it to avoid recalculation later.

Internal:
  • This member is internal (protected) and may be modified or removed in the future.
Source code: plugins/path/PathPoint.js (Line 78)

data : Object

Data associated with this point eg: { type: PathPoint.DATA_VALUE, value: XXX }

Source code: plugins/path/PathPoint.js (Line 57)

speed : number

The speed multiplier for PathFollowers on this path segment.

Source code: plugins/path/PathPoint.js (Line 52)

vx : number

The x coordinate of the tangent vector to create the curve from.

Source code: plugins/path/PathPoint.js (Line 42)

vy : number

The y coordinate of the tangent vector to create the curve from.

Source code: plugins/path/PathPoint.js (Line 47)

x : number

The x coordinate of the PathPoint.

Source code: plugins/path/PathPoint.js (Line 32)

y : number

The y coordinate of the PathPoint.

Source code: plugins/path/PathPoint.js (Line 37)

Public Methods

clone(out) → {Phaser.PathPoint}

Creates a clone of this PathPoint object.

Parameters
Name Type Argument Description
out Phaser.PathPoint <optional>

An optional PathPoint object into which this object is cloned. If no object is provided a new PathPoint is created.

Returns

A clone of this PathPoint.

Source code: plugins/path/PathPoint.js (Line 174)

copy(source) → {Phaser.PathPoint}

Copies all of the values from the given PathPoint object into this PathPoint.
The source PathPoint is untouched by this operation.

Parameters
Name Type Description
source Phaser.PathPoint

The PathPoint object to copy the values from.

Returns

This PathPoint object.

Source code: plugins/path/PathPoint.js (Line 189)

equals(pathPoint, offsetX, offsetY) → {boolean}

Compare this PathPoint with another PathPoint object and return true
if they have the same x, y and speed properties, after taking the optional
offset values into consideration.

Parameters
Name Type Argument Default Description
pathPoint Phaser.PathPoint

The PathPoint to compare against this PathPoint.

offsetX number <optional>
0

A value to apply to the x coordinate before comparison.

offsetY number <optional>
0

A value to apply to the y coordinate before comparison.

Returns
boolean -

True if the two PathPoint objects match, after the offsets are applied, or false if they don't.

Source code: plugins/path/PathPoint.js (Line 214)

setTangent(vx, vy) → {Phaser.PathPoint}

Sets the tangent vector properties of this PathPoint.

Parameters
Name Type Description
vx number

The x coordinate of the tangent vector to create the curve from.

vy number

The y coordinate of the tangent vector to create the curve from.

Returns

This object.

Source code: plugins/path/PathPoint.js (Line 154)

setTo(x, y, vx, vy) → {Phaser.PathPoint}

Sets the x, y and optionally vx and vy properties of this PathPoint.

Parameters
Name Type Argument Description
x number

The x coordinate of the PathPoint.

y number

The y coordinate of the PathPoint.

vx number <optional>

The x coordinate of the tangent vector to create the curve from.

vy number <optional>

The y coordinate of the tangent vector to create the curve from.

Returns

This object.

Source code: plugins/path/PathPoint.js (Line 122)

toJSON() → {Object}

Serializes this PathPoint into a JSON object and returns it.

Returns
Object -

A JSON object representing this PathPoint.

Source code: plugins/path/PathPoint.js (Line 236)