Header menu logo Mibo

TopDown Module

A domain module providing standard layout stamps for top-down games. These functions generate enclosed spaces, corridors, and wall structures using standard Layout primitives. They are agnostic to layer or content type, allowing flexible reuse.

Types

Type Description

CorridorDirection

Direction for corridor construction.

Functions and values

Function or value Description

corridor length width direction floor wall section

Full Usage: corridor length width direction floor wall section

Parameters:
    length : int - Length of the corridor.
    width : int - Width of the corridor (floor + walls).
    direction : CorridorDirection - Direction of the corridor.
    floor : 'T - Content for the floor.
    wall : 'T - Content for the walls.
    section : GridSection2D<'T>

Returns: GridSection2D<'T>
Modifiers: inline
Type parameters: 'T

Generates a corridor (floor with side walls). Use Layout.section to position the corridor where needed.

length : int

Length of the corridor.

width : int

Width of the corridor (floor + walls).

direction : CorridorDirection

Direction of the corridor.

floor : 'T

Content for the floor.

wall : 'T

Content for the walls.

section : GridSection2D<'T>
Returns: GridSection2D<'T>

doorway length wall section

Full Usage: doorway length wall section

Parameters:
    length : int - Total length of the wall including the gap.
    wall : 'T - Content for the wall.
    section : GridSection2D<'T>

Returns: GridSection2D<'T>
Modifiers: inline
Type parameters: 'T

Generates a wall segment with a gap (doorway opening). Position and place this where needed - it's just a wall with a 1-tile gap.

length : int

Total length of the wall including the gap.

wall : 'T

Content for the wall.

section : GridSection2D<'T>
Returns: GridSection2D<'T>

room width height floor wall section

Full Usage: room width height floor wall section

Parameters:
    width : int - Width of the room (including walls).
    height : int - Height of the room (including walls).
    floor : 'T - Content for the floor.
    wall : 'T - Content for the walls.
    section : GridSection2D<'T>

Returns: GridSection2D<'T>
Modifiers: inline
Type parameters: 'T

Generates a rectangular room with walls and floor.

width : int

Width of the room (including walls).

height : int

Height of the room (including walls).

floor : 'T

Content for the floor.

wall : 'T

Content for the walls.

section : GridSection2D<'T>
Returns: GridSection2D<'T>

scatterEdges count seed content section

Full Usage: scatterEdges count seed content section

Parameters:
    count : int
    seed : int
    content : 'T
    section : GridSection2D<'T>

Returns: GridSection2D<'T>
Modifiers: inline
Type parameters: 'T

Scatters content along the outer edges of the current section.

count : int
seed : int
content : 'T
section : GridSection2D<'T>
Returns: GridSection2D<'T>

wallSegment length wall section

Full Usage: wallSegment length wall section

Parameters:
    length : int - Length of the wall.
    wall : 'T - Content for the wall.
    section : GridSection2D<'T>

Returns: GridSection2D<'T>
Modifiers: inline
Type parameters: 'T

Generates a horizontal wall segment.

length : int

Length of the wall.

wall : 'T

Content for the wall.

section : GridSection2D<'T>
Returns: GridSection2D<'T>

weather oldContent newContent probability seed section

Full Usage: weather oldContent newContent probability seed section

Parameters:
    oldContent : 'T
    newContent : 'T
    probability : float32
    seed : int
    section : GridSection2D<'T>

Returns: GridSection2D<'T>
Modifiers: inline
Type parameters: 'T

Non-destructively decorates existing surfaces by replacing a percentage of tiles.

oldContent : 'T
newContent : 'T
probability : float32
seed : int
section : GridSection2D<'T>
Returns: GridSection2D<'T>

Type something to start searching.