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 - plugins/path/PathPoint.js, line 22

Members

<static, constant> DATA_COUNTER:number

Source - plugins/path/PathPoint.js, line 118

<static, constant> DATA_NONE:number

Source - plugins/path/PathPoint.js, line 100

<static, constant> DATA_PAUSE:number

Source - plugins/path/PathPoint.js, line 106

<static, constant> DATA_VALUE:number

Source - plugins/path/PathPoint.js, line 112

active:boolean

Is this point a selected (or active) point?

Source - plugins/path/PathPoint.js, line 84

branchPath:Phaser.Path

A branched path which is attached at this point.

Source - plugins/path/PathPoint.js, line 62

branchPointIndex:number

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

Source - 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 - plugins/path/PathPoint.js, line 72

controlPoints:array

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

Source - 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 - plugins/path/PathPoint.js, line 78

data:object

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

Source - plugins/path/PathPoint.js, line 57

speed:number

The speed multiplier for PathFollowers on this path segment.

Source - plugins/path/PathPoint.js, line 52

vx:number

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

Source - plugins/path/PathPoint.js, line 42

vy:number

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

Source - plugins/path/PathPoint.js, line 47

x:number

The x coordinate of the PathPoint.

Source - plugins/path/PathPoint.js, line 32

y:number

The y coordinate of the PathPoint.

Source - plugins/path/PathPoint.js, line 37

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:

Phaser.PathPoint-

A clone of this PathPoint.

Source - 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:

Phaser.PathPoint-

This PathPoint object.

Source - 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 - 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:

Phaser.PathPoint-

This object.

Source - 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:

Phaser.PathPoint-

This object.

Source - 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 - plugins/path/PathPoint.js, line 236