Sets the size of this physics body. Setting the size does not adjust the dimensions of the parent Game Object.
The new width of the physics body, in pixels.
The new height of the physics body, in pixels.
Optionalcenter: boolean
Should the body be re-positioned so its center aligns with the parent Game Object? Default true.
This Game Object.
Sets this physics body to use a circle for collision instead of a rectangle.
The radius of the physics body, in pixels.
OptionaloffsetX: number
The amount to offset the body from the parent Game Object along the x-axis.
OptionaloffsetY: number
The amount to offset the body from the parent Game Object along the y-axis.
This Game Object.
Sets the body offset. This allows you to adjust the difference between the center of the body and the x and y coordinates of the parent Game Object.
The amount to offset the body from the parent Game Object along the x-axis, in pixels.
Optionaly: number
The amount to offset the body from the parent Game Object along the y-axis, in pixels. Defaults to the value given for the x-axis. Default x.
This Game Object.
DEPRECATED: Please use setBodySize instead.
Sets the size of this physics body. Setting the size does not adjust the dimensions of the parent Game Object.
The new width of the physics body, in pixels.
The new height of the physics body, in pixels.
Optionalcenter: boolean
Should the body be re-positioned so its center aligns with the parent Game Object? Default true.
This Game Object.
Provides methods used for controlling the size and offset of the Arcade Physics body belonging to a Game Object. The physics body dimensions are independent of the Game Object's visual dimensions, allowing the collision area to be smaller, larger, or offset from the sprite. This component is mixed into Arcade Physics-enabled Game Objects and should not be used directly.