Phaser API Documentation


Member of: Phaser.Structs.Size



Sets, or clears, the parent of this Size component.

To clear the parent call this method with no arguments.

The parent influences the maximum extents to which this Size component can expand, based on the aspect mode:

NONE - The parent clamps both the width and height. WIDTH_CONTROLS_HEIGHT - The parent clamps just the width. HEIGHT_CONTROLS_WIDTH - The parent clamps just the height. FIT - The parent clamps whichever axis is required to ensure the size fits within it. ENVELOP - The parent is used to ensure the size fully envelops the parent.

Calling this method automatically calls setSize.


name type arguments description
parent any <optional>

Sets the parent of this Size component. Don't provide a value to clear an existing parent.


This Size component instance.

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