Camera

platypus.components. Camera

Methods

isOnCanvas(bounds) → {Boolean}

Returns whether a particular display object intersects the camera's viewport on the canvas.

Source:
Parameters:
Name Type Description
bounds PIXI.Rectangle | Object

The bounds of the display object.

Name Type Description
height Number

The height of the display object.

width Number

The width of the display object.

x Number

The left edge of the display object.

y Number

The top edge of the display object.

Returns:
Type:
Boolean

Whether the display object intersects the camera's bounds.

windowToWorld(windowVector, withOffset, vector) → {platypus.Vector}

Returns a world coordinate corresponding to a provided window coordinate.

Source:
Parameters:
Name Type Description
windowVector platypus.Vector

A vector describing a window position.

withOffset Boolean

Whether to provide a world position relative to the camera's location.

vector platypus.Vector

If provided, this is used as the return vector.

Returns:
Type:
platypus.Vector

A vector describing a world position.

worldToWindow(worldVector, withOffset, vector) → {platypus.Vector}

Returns a window coordinate corresponding to a provided world coordinate.

Source:
Parameters:
Name Type Description
worldVector platypus.Vector

A vector describing a world position.

withOffset Boolean

Whether to provide a window position relative to the camera's location.

vector platypus.Vector

If provided, this is used as the return vector.

Returns:
Type:
platypus.Vector

A vector describing a window position.