Table of Contents

Class UITransform

Namespace
Axolotl2D.UI
Assembly
Axolotl2D.dll

Positions a fixed-size UI element relative to the viewport or another UI element.

public sealed class UITransform : Component, IDisposable
Inheritance
UITransform
Implements
Inherited Members

Constructors

UITransform(GameObject, Game)

Positions a fixed-size UI element relative to the viewport or another UI element.

public UITransform(GameObject gameObject, Game game)

Parameters

gameObject GameObject
game Game

Properties

Anchor

Normalized attachment point inside the parent rectangle.

public Vector2 Anchor { get; set; }

Property Value

Vector2

AnchoredPosition

Pixel offset from the anchor.

public Vector2 AnchoredPosition { get; set; }

Property Value

Vector2

Children

public IReadOnlyList<UITransform> Children { get; }

Property Value

IReadOnlyList<UITransform>

Parent

public UITransform? Parent { get; set; }

Property Value

UITransform

Pivot

Normalized point on this rectangle placed at the anchor.

public Vector2 Pivot { get; set; }

Property Value

Vector2

Rect

public UIRect Rect { get; }

Property Value

UIRect

Size

Element size in screen pixels.

public Vector2 Size { get; set; }

Property Value

Vector2

Methods

OnDestroy()

public override void OnDestroy()

SetParent(UITransform?, bool)

Changes the layout parent and optionally preserves the element's screen position.

public void SetParent(UITransform? newParent, bool screenPositionStays = true)

Parameters

newParent UITransform
screenPositionStays bool