Point.rotate()

<static> rotate(a, x, y, angle, asDegrees, distance) → {Phaser.Point}

Rotates a Point object, or any object with exposed x/y properties, around the given coordinates by
the angle specified. If the angle between the point and coordinates was 45 deg and the angle argument
is 45 deg then the resulting angle will be 90 deg, as the angle argument is added to the current angle.

The distance allows you to specify a distance constraint for the rotation between the point and the
coordinates. If none is given the distance between the two is calculated and used.

Parameters
Name Type Argument Default Description
a Phaser.Point

The Point object to rotate.

x number

The x coordinate of the anchor point

y number

The y coordinate of the anchor point

angle number

The angle in radians (unless asDegrees is true) to rotate the Point by.

asDegrees boolean <optional>
false

Is the given angle in radians (false) or degrees (true)?

distance number <optional>

An optional distance constraint between the Point and the anchor.

Returns

The modified point object.

Source code: geom/Point.js (Line 787)
doc_phaser
2017-02-14 11:05:50
Comments
Leave a Comment

Please login to continue.