Skip to content

Schemas

Tick UI provides multi-element layout schemas. Each pushes a container rect plus a current-element rect. Advance to the next element with Next(), or Next(Size) for stack mode. Terminate with Pop().

For single-rect helpers (Top, Center, Pad, etc.), refer to Layout cheatsheet.

Picker

Schema Layout Element sizing When to use
PushSeriesHorizontal(float size, float gap = 0) 1D row. All elements equal size, with a fixed gap. A toolbar of equal-sized buttons.
PushSeriesVertical(float size, float gap = 0) 1D column. Same. A vertical list of equal-sized rows.
PushStackHorizontal(float gap) 1D row. Variable size per element, with a fixed gap. Each element's size comes from its own Next(size) call (the first one claims the first slot). A row of differently-sized chips with consistent spacing.
PushStackVertical(float step) 1D column. Same. Variable-height log lines with a fixed gap.
PushStackHorizontalReverse(float step) 1D row, right-anchored. Same. A right-anchored stack.
PushStackVerticalReverse(float step) 1D column, bottom-anchored. Same. A bottom-anchored stack.
PushSizedHorizontal(params Size[] sizes) 1D row. Explicit per-element sizes. Mix pixels and percent. A header (fixed) plus body (rest), or two-thirds-and-a-third panels.
PushSizedVertical(params Size[] sizes) 1D column. Same. A title bar (fixed) plus content (rest).
PushSizedHorizontalReverse(params Size[] sizes) 1D row, right-anchored. Explicit sizes, fills from the right. A right-anchored toolbar.
PushSizedVerticalReverse(params Size[] sizes) 1D column, bottom-anchored. Same. A bottom-anchored layout.
PushSizedHorizontalWithGap(Size gap, params Size[] sizes) 1D row. Same as the non-gap variant, but inserts gap between every pair of slots. Next() skips the inserted gap so the call shape stays one Next() per slot. Three columns with uniform spacing, without writing the gap entries by hand.
PushSizedVerticalWithGap(Size gap, params Size[] sizes) 1D column. Same. Stacked rows with uniform spacing.
PushSizedHorizontalReverseWithGap(Size gap, params Size[] sizes) 1D row, right-anchored. Same. A right-anchored toolbar with consistent gaps.
PushSizedVerticalReverseWithGap(Size gap, params Size[] sizes) 1D column, bottom-anchored. Same. A bottom-anchored layout with consistent gaps.
PushSplitHorizontal(int count, int gap = 0) 1D row. count equal elements with a gap between them. A row of N equal columns.
PushSplitVertical(int count, int gap = 0) 1D column. Same. A column of N equal rows.
PushSplit(int count, int gap, Direction direction = Direction.Horizontal) 1D, in either direction. Same. Generic split with a runtime-chosen direction.
PushGrid(int countX, int countY) 2D row-major grid. countX × countY equal cells. An inventory grid, a matrix display.
PushRadial(float minAngle, float maxAngle, float radius, float itemSize, int count) Items distributed on an arc. Equal angular spacing. A radial menu.

Pop semantics

All schemas listed here require a bare Pop(). They cannot be used inside an Auto() scope alone, because the Next() calls between elements would not match an Auto() restore. The pattern is:

ui.PushSeriesHorizontal(80, 8);
{
    DrawItem(ui, items[0]); ui.Next();
    DrawItem(ui, items[1]); ui.Next();
    DrawItem(ui, items[2]);
}
ui.Pop();

Auto() is fine for the contents of an individual element, just not for the schema itself.

Additional resources

  • Layout cheatsheet: single-rect helpers.
  • Layout: the workflow side, including the Auto() rule and the schema syntax in detail.
  • Stacks: the rect stack's contract.