Class: ObservablePoint

PIXI.ObservablePoint

The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis. An observable point is a point that triggers a callback when the point's position is changed.

new PIXI.ObservablePoint (cb, scope, x, y)

Name Type Default Description
cb function

callback when changed

scope object

owner of callback

x number 0 optional

position of the point on the x axis

y number 0 optional

position of the point on the y axis

Members

x number

The position of the displayObject on the x axis relative to the local coordinates of the parent.

y number

The position of the displayObject on the x axis relative to the local coordinates of the parent.

Methods

copy () Deprecated : since 5.0.0

See:

copyFrom (p)

Copies x and y from the given point

Name Type Description
p PIXI.Point

The point to copy from.

Returns:
Returns itself.

Copies x and y into the given point

Name Type Description
p PIXI.Point

The point to copy.

Returns:
Given point with values updated

Sets the point to a new x and y position. If y is omitted, both x and y will be set to x.

Name Type Default Description
x number 0 optional

position of the point on the x axis

y number 0 optional

position of the point on the y axis