The angle of this Game Object as expressed in degrees.
Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left and -90 is up.
If you prefer to work in radians, see the rotation property instead.
ReadonlyhasA property indicating that a Game Object has this component.
The angle of this Game Object in radians.
Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left and -PI/2 is up.
If you prefer to work in degrees, see the angle property instead.
This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object
to the same value, at the same time. When reading this value the result returned is (scaleX + scaleY) / 2.
Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this
isn't the case, use the scaleX or scaleY properties instead.
The horizontal scale of this Game Object.
The vertical scale of this Game Object.
The w position of this Game Object.
The x position of this Game Object.
The y position of this Game Object.
The z position of this Game Object.
Note: The z position does not control the rendering order of 2D Game Objects. Use Phaser.GameObjects.Components.Depth#depth instead.
Copies an object's coordinates to this Game Object's position.
An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied.
This Game Object instance.
Takes the given x and y coordinates and converts them into local space for this
Game Object, taking into account parent and local transforms, and the Display Origin.
The returned Vector2 contains the translated point in its properties.
A Camera needs to be provided in order to handle modified scroll factors. If no
camera is specified, it will use the main camera from the Scene to which this
Game Object belongs.
The translated point.
Gets the local transform matrix for this Game Object.
OptionaltempMatrix: TransformMatrix
The matrix to populate with the values from this Game Object.
The populated Transform Matrix.
Gets the sum total rotation of all of this Game Object's parent Containers.
The returned value is in radians and will be zero if this Game Object has no parent container.undefined
The sum total rotation, in radians, of all parent containers of this Game Object.
Gets the world position of this Game Object, factoring in any parent Containers.
Optionalpoint: Vector2
A Vector2, or point-like object, to store the result in.
OptionaltempMatrix: TransformMatrix
A temporary matrix to hold the Game Object's values.
OptionalparentMatrix: TransformMatrix
A temporary matrix to hold parent values.
The world position of this Game Object.
Gets the world transform matrix for this Game Object, factoring in any parent Containers.
OptionaltempMatrix: TransformMatrix
The matrix to populate with the values from this Game Object.
OptionalparentMatrix: TransformMatrix
A temporary matrix to hold parent values during the calculations.
The populated Transform Matrix.
Sets the angle of this Game Object.
Optionaldegrees: number
The rotation of this Game Object, in degrees. Default 0.
This Game Object instance.
Sets the position of this Game Object.
Optionalx: number
The x position of this Game Object. Default 0.
Optionaly: number
The y position of this Game Object. If not set it will use the x value. Default x.
Optionalz: number
The z position of this Game Object. Default 0.
Optionalw: number
The w position of this Game Object. Default 0.
This Game Object instance.
Sets the position of this Game Object to be a random position within the confines of the given area.
If no area is specified a random position between 0 x 0 and the game width x height is used instead.
The position does not factor in the size of this Game Object, meaning that only the origin is guaranteed to be within the area.
Optionalx: number
The x position of the top-left of the random area. Default 0.
Optionaly: number
The y position of the top-left of the random area. Default 0.
Optionalwidth: number
The width of the random area.
Optionalheight: number
The height of the random area.
This Game Object instance.
Sets the rotation of this Game Object.
Optionalradians: number
The rotation of this Game Object, in radians. Default 0.
This Game Object instance.
Sets the scale of this Game Object.
Optionalx: number
The horizontal scale of this Game Object. Default 1.
Optionaly: number
The vertical scale of this Game Object. If not set it will use the x value. Default x.
This Game Object instance.
Sets the w position of this Game Object.
Optionalvalue: number
The w position of this Game Object. Default 0.
This Game Object instance.
Sets the x position of this Game Object.
Optionalvalue: number
The x position of this Game Object. Default 0.
This Game Object instance.
Sets the y position of this Game Object.
Optionalvalue: number
The y position of this Game Object. Default 0.
This Game Object instance.
Sets the z position of this Game Object.
Note: The z position does not control the rendering order of 2D Game Objects. Use Phaser.GameObjects.Components.Depth#setDepth instead.
Optionalvalue: number
The z position of this Game Object. Default 0.
This Game Object instance.
Provides methods used for getting and setting the position, scale and rotation of a Game Object.