Class AspectRatioContainer

Namespace
Forma
Assembly
Forma.dll

Constrains visible children to a target aspect ratio using fit, cover, or axis-driven sizing and alignment.

public sealed class AspectRatioContainer : Container, IAddChild<Control>, IAddChild, INotifyPropertyChanged
Inheritance
AspectRatioContainer
Implements
Inherited Members

Constructors

AspectRatioContainer()

public AspectRatioContainer()

Properties

AlignmentHorizontal

public AspectRatioAlignment AlignmentHorizontal { get; set; }

Property Value

AspectRatioAlignment

AlignmentVertical

public AspectRatioAlignment AlignmentVertical { get; set; }

Property Value

AspectRatioAlignment

Ratio

public float Ratio { get; set; }

Property Value

float

StretchMode

public AspectRatioMode StretchMode { get; set; }

Property Value

AspectRatioMode

Methods

ArrangeChildren()

protected override void ArrangeChildren()

GetChildRect(Vector2)

Calculates the local child rectangle using Godot's ratio, mode, and alignment rules.

public Rectangle GetChildRect(Vector2 childMinimumSize)

Parameters

childMinimumSize Vector2

Returns

Rectangle

GetMinimumSize()

public override Vector2 GetMinimumSize()

Returns

Vector2