Phaser API Documentation

  Version: 
setSize(width, height, [center])

Description:

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.

Parameters:

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?

Returns:
Description:

This Game Object.

Examples:
Since: 3.0.0