Phaser API Documentation

  Version: 
setSize(width, height)

Description:

Sets the internal size of this Rectangle, as used for frame or physics body creation.

If you have assigned a custom input hit area for this Rectangle, changing the Rectangle size will not change the size of the hit area. To do this you should adjust the input.hitArea object directly.

Parameters:

name type description
width number

The width of this Game Object.

height number

The height of this Game Object.

Returns:
Description:

This Game Object instance.

Since: 3.13.0