Attention: Here be dragons
This is the
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
Inherits: Container < Control < CanvasItem < Node < Object
Container that preserves its child controls' aspect ratio.
Arranges child controls in a way to preserve their aspect ratio automatically whenever the container is resized. Solves the problem where the container size is dynamic and the contents' size needs to adjust accordingly without losing proportions.
StretchMode STRETCH_WIDTH_CONTROLS_HEIGHT =
The height of child controls is automatically adjusted based on the width of the container.
StretchMode STRETCH_HEIGHT_CONTROLS_WIDTH =
The width of child controls is automatically adjusted based on the height of the container.
StretchMode STRETCH_FIT =
The bounding rectangle of child controls is automatically adjusted to fit inside the container while keeping the aspect ratio.
StretchMode STRETCH_COVER =
The width and height of child controls is automatically adjusted to make their bounding rectangle cover the entire area of the container while keeping the aspect ratio.
When the bounding rectangle of child controls exceed the container's size and Control.clip_contents is enabled, this allows to show only the container's area restricted by its own bounding rectangle.
AlignmentMode ALIGNMENT_BEGIN =
Aligns child controls with the beginning (left or top) of the container.
AlignmentMode ALIGNMENT_CENTER =
Aligns child controls with the center of the container.
AlignmentMode ALIGNMENT_END =
Aligns child controls with the end (right or bottom) of the container.
AlignmentMode alignment_horizontal =
void set_alignment_horizontal ( AlignmentMode value )
AlignmentMode get_alignment_horizontal ( )
Specifies the horizontal relative position of child controls.
AlignmentMode alignment_vertical =
void set_alignment_vertical ( AlignmentMode value )
AlignmentMode get_alignment_vertical ( )
Specifies the vertical relative position of child controls.
float ratio =
The aspect ratio to enforce on child controls. This is the width divided by the height. The ratio depends on the stretch_mode.
StretchMode stretch_mode =
void set_stretch_mode ( StretchMode value )
StretchMode get_stretch_mode ( )
The stretch mode used to align child controls.