Phaser API Documentation


Member of: Phaser.Structs.Size

resize(width, [height])


Sets a new width and height for this Size component and updates the aspect ratio based on them.

It doesn't change the aspectMode and still factors in size limits such as the min max and parent bounds.


name type arguments Default description
width number

The new width of the Size component.

height number <optional> width

The new height of the Size component. If not given, it will use the width.


This Size component instance.

Since: 3.16.0
Source: src/structs/Size.js (Line 380)