Phaser API Documentation

  Version: 

Member of: Phaser.Math

<static> TransformXY(x, y, positionX, positionY, rotation, scaleX, scaleY, [output])

Description:

Takes the x and y coordinates and transforms them into the same space as defined by the position, rotation and scale values.

Parameters:

name type arguments description
x number

The x coordinate to be transformed.

y number

The y coordinate to be transformed.

positionX number

Horizontal position of the transform point.

positionY number

Vertical position of the transform point.

rotation number

Rotation of the transform point, in radians.

scaleX number

Horizontal scale of the transform point.

scaleY number

Vertical scale of the transform point.

output object | Phaser.Math.Vector2 | Phaser.Geom.Point <optional>

The output vector, point or object for the translated coordinates.

Returns:
Description:

The translated point.

Since: 3.0.0
Source: src/math/TransformXY.js (Line 9)