Logo Mibo

Stamp Module

Functions and values

Function or value Description

Stamp.above top bottom

Full Usage: Stamp.above top bottom

Parameters:
Returns: Stamp<'T>
Type parameters: 'T

Stacks `bottom` under `top`. Size is the larger of the two widths and the sum of heights.

top : Stamp<'T>
bottom : Stamp<'T>
Returns: Stamp<'T>

Stamp.beside first second

Full Usage: Stamp.beside first second

Parameters:
Returns: Stamp<'T>
Type parameters: 'T

Places `second` right of `first`. Size is the sum of widths and the larger of the two heights.

first : Stamp<'T>
second : Stamp<'T>
Returns: Stamp<'T>

Stamp.box w h styles

Full Usage: Stamp.box w h styles

Parameters:
    w : int
    h : int
    styles : BoxStyle<'T> list

Returns: Stamp<'T>
Type parameters: 'T

A sized box painted by a list of box styles (`Flow.fill`, `Flow.border`, `Flow.noise`, ...). The size is stated once, here; styles and containers never need coordinates. For a context-sized box (grid areas, docked rectangles, expanded slots) use `Flow.canvas`.

w : int
h : int
styles : BoxStyle<'T> list
Returns: Stamp<'T>

Stamp.create w h paint

Full Usage: Stamp.create w h paint

Parameters:
Returns: Stamp<'T>
Type parameters: 'T

Creates a leaf element with a fixed cell footprint.

w : int
h : int
paint : GridSection2D<'T> -> unit
Returns: Stamp<'T>

Stamp.empty ()

Full Usage: Stamp.empty ()

Parameters:
    () : unit

Returns: Stamp<'T>
Type parameters: 'T

Empty element that paints nothing.

() : unit
Returns: Stamp<'T>

Stamp.expand stamp

Full Usage: Stamp.expand stamp

Parameters:
Returns: Stamp<'T>
Type parameters: 'T

Marks an element to share the leftover main-axis space of its container with weight 1. Expanded elements split the leftover space by weight. Only `Flow.row` and `Flow.column` act on `Expand`; other containers throw when a direct child carries it. Combinators (`beside`, `above`, `overlay`, `inset`, `offset`, `repeat`) throw when the wrapped element carries it; apply `expand` to the composite instead.

stamp : Stamp<'T>
Returns: Stamp<'T>

Stamp.expandWeight weight stamp

Full Usage: Stamp.expandWeight weight stamp

Parameters:
    weight : int
    stamp : Stamp<'T>

Returns: Stamp<'T>
Type parameters: 'T

Like `expand` but with an explicit share weight.

weight : int
stamp : Stamp<'T>
Returns: Stamp<'T>

Stamp.inset n stamp

Full Usage: Stamp.inset n stamp

Parameters:
    n : int
    stamp : Stamp<'T>

Returns: Stamp<'T>
Type parameters: 'T

Shrinks the paint area of `stamp` by `n` cells on all sides and grows the footprint to `stamp + 2n`. The gutter stays empty.

n : int
stamp : Stamp<'T>
Returns: Stamp<'T>

Stamp.insetEx inset stamp

Full Usage: Stamp.insetEx inset stamp

Parameters:
Returns: Stamp<'T>
Type parameters: 'T

Shrinks the paint area of `stamp` by explicit per-side amounts.

inset : InsetSpec
stamp : Stamp<'T>
Returns: Stamp<'T>

Stamp.named name stamp

Full Usage: Stamp.named name stamp

Parameters:
    name : string
    stamp : Stamp<'T>

Returns: Stamp<'T>
Type parameters: 'T

Names an element so `Flow.run` reports its resolved rectangle. Names must be unique: a duplicate name throws at build time.

name : string
stamp : Stamp<'T>
Returns: Stamp<'T>

Stamp.offset dx dy stamp

Full Usage: Stamp.offset dx dy stamp

Parameters:
    dx : int
    dy : int
    stamp : Stamp<'T>

Returns: Stamp<'T>
Type parameters: 'T

Shifts the paint position of `stamp` by a signed offset. The footprint grows to cover both the original and the shifted area. Negative offsets shift within the enlarged footprint and clamp at the container edge.

dx : int
dy : int
stamp : Stamp<'T>
Returns: Stamp<'T>

Stamp.overlay first second

Full Usage: Stamp.overlay first second

Parameters:
Returns: Stamp<'T>
Type parameters: 'T

Draws both elements over the full area of the container, `second` on top. Both elements are full-bleed stack children (`canvas`, `docked`, `at`, `strip`, `stretch`), so a sized element throws at construction — it would silently paint the whole area. The footprint is zero: the composite is context-sized.

first : Stamp<'T>
second : Stamp<'T>
Returns: Stamp<'T>

Stamp.repeat count stamp

Full Usage: Stamp.repeat count stamp

Parameters:
    count : int
    stamp : Stamp<'T>

Returns: Stamp<'T>
Type parameters: 'T

Repeats `stamp` `count` times, side by side with no gap.

count : int
stamp : Stamp<'T>
Returns: Stamp<'T>

Stamp.sized w h paint

Full Usage: Stamp.sized w h paint

Parameters:
Returns: Stamp<'T>
Type parameters: 'T

Wraps an existing section-transforming stamp (any `Layout.*` pipeline) as a sized element. The wrapped stamp still paints with local coordinates.

w : int
h : int
paint : GridSection2D<'T> -> GridSection2D<'T>
Returns: Stamp<'T>

Stamp.tagged tags stamp

Full Usage: Stamp.tagged tags stamp

Parameters:
    tags : string list
    stamp : Stamp<'T>

Returns: Stamp<'T>
Type parameters: 'T

Tags an element so `Flow.run` groups its resolved rectangle under each tag and marks the covered cells in the per-tag bit grids. Tags are opaque to the engine; the game defines what they mean. Multiple elements can share a tag, and one element can carry several.

tags : string list
stamp : Stamp<'T>
Returns: Stamp<'T>

Type something to start searching.