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
AlignmentVertical
public AspectRatioAlignment AlignmentVertical { get; set; }
Property Value
Ratio
public float Ratio { get; set; }
Property Value
StretchMode
public AspectRatioMode StretchMode { get; set; }
Property Value
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
childMinimumSizeVector2
Returns
- Rectangle
GetMinimumSize()
public override Vector2 GetMinimumSize()
Returns
- Vector2