Phaser API Documentation

setSize(width, height, [center])


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.


name type arguments Default description
width number

The new width of the physics body, in pixels.

height number

The new height of the physics body, in pixels.

center boolean <optional> true

Should the body be re-positioned so its center aligns with the parent Game Object?


This Game Object.

Since: 3.0.0