Skip to content

Class: UITransformComponent ​

A UI rect around the entity's origin. The anchor is the origin's spot in the rect, from the bottom-left (y-up, Unity's pivot): (0, 0) bottom-left, (0.5, 0.5) centre, (0, 1) top-left. The rect spans [-anchorX·w, (1-anchorX)·w] × [-anchorY·h, (1-anchorY)·h] in local space.

Extends ​

Constructors ​

Constructor ​

ts
new UITransformComponent(
   width?, 
   height?, 
   anchorX?, 
   anchorY?
): UITransformComponent;

Parameters ​

ParameterTypeDefault value
widthnumber100
heightnumber100
anchorXnumber0.5
anchorYnumber0.5

Returns ​

UITransformComponent

Overrides ​

Component.constructor

Properties ​

PropertyModifierTypeDefault valueInherited from
anchorXpublicnumberundefined-
anchorYpublicnumberundefined-
dirtypublicbooleantrueComponent.dirty
enabledpublicbooleantrueComponent.enabled
heightpublicnumberundefined-
widthpublicnumberundefined-

© 2026 PlayAdGentic