Skip to content

Absolute Positioning & Placement

For everything that doesn’t flow with Row/Column/Grid: badges, overlays, popovers, backgrounds, and per-side anchored panels. AutoLayout handles these via two related concepts:

  • Placement — how this element relates to its parent’s layout flow.
  • Absolute axis constraints — for Placement.Absolute, where exactly it sits (Top/Bottom/Left/Right edge offsets).
The Size & Position inspector section of an absolute child, with the Absolute Item Settings constraints.

Placement modes

Set via .Absolute(), .Cover(), .Ignored(), or .Layout(LayoutType.X) on the parent.

ModeBehaviourUse it for
Relative To Parent (default)Participates in parent’s Row/Column/Grid flowMost children
AbsoluteSized normally, positioned relative to parent’s content rect via Top/Bottom/Left/RightBadges, popovers, anchored UI
CoverParentStretches to match parent’s full bounds (ignores parent’s padding)Backgrounds, overlays, modal scrims
IgnoredSized by AutoLayout, positioned externallyListView/GridView pooled items (don’t use directly)
CollapsedRemoved from layout entirely (stays in the hierarchy)Hiding an element without disabling the GameObject

The container’s LayoutType is separate — see Layout Type.

Absolute children — the four constraints

When a child has Placement.Absolute, you anchor it to one or two edges per axis.

Single-edge anchor

Single-edge anchor

Single-edge anchor

Sized normally, positioned relative to parent's content rect via Top/Bottom/Left/Right — a floating panel pinned to a corner.

On the child, set Placement to Absolute. The Absolute Position edge fields then appear — anchor one edge (e.g. top and right) to pin the element to a corner.

Each Top/Bottom/Left/Right takes a UIPosition:

UIPosition.Pixels(20) // 20px offset
UIPosition.Percentage(10) // 10% of parent's axis
UIPosition.None() // no constraint on this side (use opposite anchor)

Stretch (two-edge anchor)

To stretch an absolute element across an axis, anchor both edges via LeftRight or TopBottom:

Stretch (two-edge anchor)

Stretch (two-edge anchor)

Anchor both edges so the element grows to fill the space between the two offsets — its Width/Height is ignored on that axis.

Set Placement to Absolute, then in Absolute Position anchor two opposite edges (e.g. left and right) so the element stretches between the two offsets. Its size on that axis is ignored.

LeftRight and TopBottom set the anchor to Stretch so the element grows to fill the space between the two offsets — its Width/Height is ignored on that axis.

Combinations

WantConstraint setup
Pinned to top-left corner.Top(...) + .Left(...) (Width/Height from sizing)
Pinned to bottom-right.Bottom(...) + .Right(...)
Stretched horizontally, pinned to top.LeftRight(a, b) + .Top(...)
Stretched both axes (= Cover with margin).LeftRight(a, b) + .TopBottom(c, d)
Centered horizontally.Width(X) + don’t set .Left/.Right (positions at center by default), or compute via percentages

CoverParent — the simplest overlay

When you just want “fill my parent completely,” use .Cover():

CoverParent overlay

CoverParent overlay

Stretches to match the parent's full bounds, ignoring padding — ideal for full-bleed backgrounds and modal scrims.

On the child, set Placement to Cover. The element stretches to the parent’s full bounds, ignoring the parent’s padding — ideal for backgrounds and modal scrims.

Cover() ignores the parent’s padding. Useful for full-bleed backgrounds and modal scrims that should darken the entire parent including its padded region.

Ignored placement

.Ignored() tells AutoLayout: “size this element, but I’ll position it myself externally.” This is what ListView and GridView use for pooled items — they reuse the same item GameObjects across many positions, AutoLayout sizes them, and the View moves them around manually.

Don’t use this directly unless you’re writing a virtualised list/grid.

Order and Visibility

Two related properties for “this child exists but I want to control its visibility/order” — set Order to render a child before or after its hierarchy siblings, and Visibility to draw, hide, or collapse it.

PropertyValuesBehaviour
Order(int)any int (default 0)Override visual order. Lower = earlier.
Visibility(...) / Hidden() / Collapsed()Visible / Hidden / CollapsedVisible: normal. Hidden: invisible but takes layout space. Collapsed: removed from layout entirely.

Hidden is useful for tabs/panels you want to keep mounted but not draw. Collapsed is for fully removing an element without re-layout cost on the next show.

Common patterns

Badge in the corner of a card

A Hug-sized card (Column layout) with a small badge child whose Placement is Absolute, anchored to the top and right edges with negative offsets so it sticks out past the card’s corner. See the Code API for the builder version.

Modal pattern (centered + backdrop)

Modal pattern (centered + backdrop)

A full-bleed dark backdrop plus a centered card — the canonical modal/dialog layout.

Give the backdrop Placement = Cover for the full-bleed scrim. Center the card by setting its parent’s Alignment to center on both axes.

A fill-sized container holding a scrolling body, plus a Hug-height footer child whose Placement is Absolute, stretched across the bottom edge (left and right both anchored, pinned to the bottom) so it floats over the scroll content. See the Code API for the builder version.

  • Layout TypeLayoutType.Absolute on the container makes every child default to absolute
  • Sizing — how Width/Height interact with absolute constraints
  • AutoUI — builder reference
Docs for AutoLayout PRO v1.0.0 Changelog