Logo Mibo

Mibo.Layout Namespace

Type/Module Description

Align

Alignment of children relative to the container. Used on the cross axis (`FlowOpts.Align`) and the main axis (`FlowOpts.Justify`). `Stretch` behaves as `Start` when used as `Justify`.

BoxStyle<'T>

A box style: paints the whole area of the element it is applied to, relative to that area. Box styles never take coordinates; they combine in `Stamp.box` and `Flow.canvas` (`Flow.fill`, `Flow.border`, `Flow.noise`, ...).

CellGeometry

The geometry of a `CellGrid2D`. Hexagons are stored as offset columns and rows in the same rectangular array as squares, so cell storage and layout authoring are identical; only world positions and spatial queries differ.

CellGrid2D

CellGrid2D<'T>

A 2D grid of optional cells. Square by default; `CellGrid2D.createHex` builds the hex variant over the same storage.

CellPoint

A cell coordinate: x across, y down. The named pair the paint styles take where bare x/y ints could be transposed.

CellRect

Resolved rectangle of a placed element, in grid cells.

CircleSpec

A midpoint circle spec: the center, the radius, and whether the interior spans.

Dock

Edge anchoring flags for `Flow.dock`. Combine with `|||`, for example `Dock.Top ||| Dock.CenterX`. When opposite edges are set the top/left edge wins; `Stretch` wins over the edge flags of its axis. A zero footprint dimension stretches on its axis, with or without the `Stretch` flag.

DockSpec<'T>

A dock spec: where the element anchors (`Anchor`, combining `Dock` values with `|||`, for example `Dock.Top ||| Dock.CenterX`), the per-side inset from the container edges in cells, and the element to dock.

Flow

Build-time level authoring: stamps, box styles, containers, and landmark recording all run when the level builds (`Flow.run`/`Flow.build`), never per frame. Build once, then keep per-frame queries on `Flow.isTag`, or hoist the lookup with `Flow.tryTagGrid`. Hex grids author identically: build the grid with `CellGrid2D.createHex` and run the same document. Authoring is cell-space, so geometry affects world positions and spatial queries only; reported rectangles are offset-space bounding boxes.

FlowOpts

Options for `Flow.row` and `Flow.column` containers.

Grid2DSpatial

GridOpts<'T>

Options and content for `Flow.grid`: track sizes, the area template, the gap between tracks, and the stamps placed into named areas or explicit slots. Every area name in `Places` must match a template area; every slot must fit inside the declared tracks.

GridSection2D<'T>

Hex2DSpatial

HexOrientation

The orientation of a hex grid's cells.

HexSpec

Hex construction parameters for `CellGrid2D.createHex`: the cell orientation, the extents in cells, the hex radius (center to corner), and the world-space origin.

InsetSpec

Per-side inset amounts, in cells.

InstanceSpan

How many cells one drawn instance covers.

Landmarks (Module)

Landmarks (Type)

Landmarks collected while a level lays out: named element rectangles, tag groups of rectangles, and per-cell tag bit grids for fast walking queries. Tags are opaque strings; the engine stores and queries them, the game defines what they mean.

Layout

LayoutHelpers

Occupancy (Module)

Occupancy (Type)

The occupancy a build derives from a painted grid: the cell of every drawn instance, the rectangle each one covers, and which instance owns each cell. A plain cell owns itself; a spanning cell owns its whole rectangle. Every cell that carries a value also carries an owner, so a query no longer reads `ValueNone` for a cell that an instance covers from elsewhere. Build it once with `Occupancy.scan` and read it per frame.

Place

Where a `Flow.grid` place mounts: a named template area, or an explicit cell slot — the column and row track indices it starts at, with spans. Slots may overlap; paint order is `Places` order, later places on top.

ScatterLineSpec

A scattered-line spec: the segment to scatter along, how many cells to pick, and the generator seed.

ScatterSpec

A seeded scatter spec: how many cells to pick, and the generator seed.

Stack

How a stack of layers stands in height. A layer that draws above another needs the height the layers below it reach at each cell, so its columns stand on them instead of replacing them.

Stamp

Stamp<'T>

A sized, composable element for the Flow layout DSL. `W`/`H` are the element footprint in cells; `Paint` draws into a section of that footprint. `Tags` are opaque strings recorded into the landmark registry with the element's resolved rectangle. Holds a function value, so it never uses structural equality.

StampPaint<'T>

Paint signature of a stamp. The landmark registry is filled while the level lays out; ad-hoc paints pass ValueNone.

Track

A single track of a `Flow.grid` template. `Fixed` tracks take literal cells; `Auto` tracks size to the largest footprint of their span-1 places at construction (a context-sized place reports no footprint, so it contributes nothing), and a place that spans several tracks shares its footprint over the `Auto` tracks it covers; `Weight` tracks (`fr`) share the space left after `Fixed`, `Auto` and `Percent` tracks; `Percent` is a fraction of the assigned container length.

WeatherSpec

A probabilistic rewrite spec: the chance any matching cell changes, and the generator seed.

Type something to start searching.