Skip to main content

Interface: RectTransformDefaultedOptions

Defined in: ui/components/rect-transform-component.ts:10

Fields of RectTransformEcsComponent with a sensible default; callers may omit these.

Properties​

anchoredPosition​

anchoredPosition: Vector2

Defined in: ui/components/rect-transform-component.ts:27

Offset of this element's pivot from its anchor reference point, in reference pixels (UI world units).


rect​

rect: Rect

Defined in: ui/components/rect-transform-component.ts:35

The resolved rect, in UI world space. Written every frame by createUiLayoutEcsSystem from x/y/anchoredPosition and the parent's own resolved rect - do not set this directly, it's overwritten on the next layout pass.


sortDepth​

sortDepth: number

Defined in: ui/components/rect-transform-component.ts:47

This element's hierarchy pre-order index within its canvas, written every frame by createUiLayoutEcsSystem - the same value it writes into SpriteEcsComponent.sortDepth/TextEcsComponent.sortDepth for elements that have one, so draw order follows hierarchy order within a canvas rather than world Y. Elements with neither still get one here, since createUiRaycastEcsSystem needs a topmost-first ordering for every interactable regardless of whether it happens to draw anything. Do not set this directly.


x​

x: UiAxis

Defined in: ui/components/rect-transform-component.ts:18

This element's horizontal anchoring. A UiPointAxis (anchorMin.x == anchorMax.x) keeps a literal size and moves with the anchor; a UiStretchAxis resizes with the parent's width, with margin added to the anchored span. See UiAnchor for common x/y presets, and UiAxis's own point/stretch factories for building one directly.


y​

y: UiAxis

Defined in: ui/components/rect-transform-component.ts:21

This element's vertical anchoring - see x.