Rectangle#getPoint()

getPoint(position, out) → {Phaser.Point}

Returns a point based on the given position constant, which can be one of:

Phaser.TOP_LEFT, Phaser.TOP_CENTER, Phaser.TOP_RIGHT, Phaser.LEFT_CENTER,
Phaser.CENTER, Phaser.RIGHT_CENTER, Phaser.BOTTOM_LEFT, Phaser.BOTTOM_CENTER
and Phaser.BOTTOM_RIGHT.

This method returns the same values as calling Rectangle.bottomLeft, etc, but those
calls always create a new Point object, where-as this one allows you to use your own.

Parameters
Name Type Argument Description
position integer <optional>

One of the Phaser position constants, such as Phaser.TOP_RIGHT.

out Phaser.Point <optional>

A Phaser.Point that the values will be set in.
If no object is provided a new Phaser.Point object will be created. In high performance areas avoid this by re-using an existing object.

Returns

An object containing the point in its x and y properties.

Source code: geom/Rectangle.js (Line 386)
doc_phaser
2017-02-14 11:06:56
Comments
Leave a Comment

Please login to continue.