Mibo.Layout Namespace
| Type/Module | Description |
|
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`. |
|
|
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`, ...). |
|
|
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. |
|
|
|
|
|
A 2D grid of optional cells. Square by default; `CellGrid2D.createHex` builds the hex variant over the same storage. |
|
|
A cell coordinate: x across, y down. The named pair the paint styles take where bare x/y ints could be transposed. |
|
|
Resolved rectangle of a placed element, in grid cells. |
|
|
A midpoint circle spec: the center, the radius, and whether the interior spans. |
|
|
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. |
|
|
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. |
|
|
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. |
|
|
Options for `Flow.row` and `Flow.column` containers. |
|
|
|
|
|
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. |
|
|
|
|
|
|
|
|
The orientation of a hex grid's cells. |
|
|
Hex construction parameters for `CellGrid2D.createHex`: the cell orientation, the extents in cells, the hex radius (center to corner), and the world-space origin. |
|
|
Per-side inset amounts, in cells. |
|
|
How many cells one drawn instance covers. |
|
|
|
|
|
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. |
|
|
|
|
|
|
|
|
|
|
|
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. |
|
|
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. |
|
|
A scattered-line spec: the segment to scatter along, how many cells to pick, and the generator seed. |
|
|
A seeded scatter spec: how many cells to pick, and the generator seed. |
|
|
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. |
|
|
|
|
|
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. |
|
|
Paint signature of a stamp. The landmark registry is filled while the level lays out; ad-hoc paints pass ValueNone. |
|
|
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. |
|
|
A probabilistic rewrite spec: the chance any matching cell changes, and the generator seed. |
Mibo