Use angle to set or get the rotation of the physics body associated with this Game Object.
Unlike rotation, when setting this value it is specified in degrees, which are converted to radians internally.
Use rotation to set or get the rotation of the physics body associated with this GameObject.
The value when set must be in radians.
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 x position of this Game Object.
The y position of this Game Object.
Immediately sets the angle of the Body. Angular velocity, position, force etc. are unchanged.
Optionaldegrees: number
The angle to set, in degrees. Default 0.
This Game Object instance.
Setting fixed rotation sets the Body inertia to Infinity, which stops it from being able to rotate when forces are applied to it.undefined
This Game Object instance.
Sets the position of the physics body along the x and y axes. Both parameters are optional and default to 0 if not provided. Velocity, angle, force etc. are unchanged.
Optionalx: number
The horizontal position of the body. Default 0.
Optionaly: number
The vertical position of the body. Default x.
This Game Object instance.
Immediately sets the angle of the Body. Angular velocity, position, force etc. are unchanged.
Optionalradians: number
The angle of the body, in radians. Default 0.
This Game Object instance.
Sets the scale of this Game Object and its underlying Matter.js physics body.
The optional point parameter specifies the origin from which scaling will occur.
If omitted, scaling is applied from the body's current position.
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.
Optionalpoint: Vector2
The point (Vector2) from which scaling will occur.
This Game Object instance.
Provides methods used for getting and setting the position, scale, and rotation of a Matter.js physics-enabled Game Object. This component acts as a bridge between the Game Object's visual transform and its underlying Matter.js physics body, keeping them synchronized. It is mixed into Game Objects that use the Matter.js physics system and should not be used directly.