Class ScyllaUIPositioned
Per-child placement override for a direct child of a ScyllaUIZStack. Specifies a 9-point reference anchor on the parent's inner content area plus per-axis offsets expressed as ScyllaUILength values.
Inherited Members
Namespace: Scylla.Core.Util.UI
Assembly: ScyllaCore.dll
Syntax
[AddComponentMenu("Scylla/UI/Layout/Positioned")]
[DisallowMultipleComponent]
[RequireComponent(typeof(RectTransform))]
[ExecuteAlways]
public sealed class ScyllaUIPositioned : MonoBehaviour
Remarks
The reference point is determined by Anchor and maps to one of
nine positions inside the parent's inner content area: the four corners
(UpperLeft, UpperRight, LowerLeft, LowerRight),
the four edge midpoints, and the center (MiddleCenter). The child's
top-left corner is then placed at the reference point plus the resolved
OffsetX and OffsetY values.
Positive OffsetX moves the child to the right; positive OffsetY moves the child downward, following uGUI's top-left coordinate convention where Y grows downward.
When this component is absent, a ZStack child either fills the entire inner
content area (Stretch) or is placed at
the corner determined by the ZStack's CrossAlignment. Attaching
ScyllaUIPositioned replaces that default placement with the
explicit anchor-plus-offset specified here.
The component is silently ignored when the host RectTransform is not a direct child of a ScyllaUIZStack. Any property change marks the parent dirty and schedules a re-solve.
Properties
Anchor
The 9-point reference anchor that selects the placement origin inside the parent ScyllaUIZStack's inner content area. Changing this value marks the parent dirty and schedules a re-solve.
Declaration
public TextAnchor Anchor { get; set; }
Property Value
| Type | Description |
|---|---|
| TextAnchor |
OffsetX
Horizontal offset from the anchor reference point. Resolved against the parent ZStack's inner width at solve time. Positive values shift the child to the right; negative values shift it to the left. Setting this property marks the parent dirty and schedules a re-solve.
Declaration
public ScyllaUILength OffsetX { get; set; }
Property Value
| Type | Description |
|---|---|
| ScyllaUILength |
OffsetY
Vertical offset from the anchor reference point. Resolved against the parent ZStack's inner height at solve time. Positive values shift the child downward following uGUI's top-left coordinate convention. Setting this property marks the parent dirty and schedules a re-solve.
Declaration
public ScyllaUILength OffsetY { get; set; }
Property Value
| Type | Description |
|---|---|
| ScyllaUILength |