parin.joka.game

The game module provides game related types and functions.

Types 53

aliasPalette(Sz N) = StaticArray!(Rgba, N)

A generic color palette of RGBA colors.

aliasHexPalette(Sz N) = uint[N]

A generic color palette of hexadecimal numbers.

enumWisp2 : Rgba

A 2-color palette inspired by the Playdate. Link: https://kapendev.itch.io/will-of-the-hair-wisp

black = toRgb(wisp2[0])#322F29
white = toRgb(wisp2[1])#DAD6D0
enumGb4 : Rgba

A 4-color palette inspired by the Game Boy. Link: https://lospec.com/palette-list/2-bit-matrix

black = toRgb(gb4[0])#343434
darkGray = toRgb(gb4[1])#5B8C7C
lightGray = toRgb(gb4[2])#ADD9BC
white = toRgb(gb4[3])#F2FFF2
enumNes8 : Rgba

An 8-color palette inspired by the NES. Link: https://lospec.com/palette-list/mf-8

black = toRgb(nes8[0])#292320
brown = toRgb(nes8[1])#A7763E
purple = toRgb(nes8[2])#7F339A
red = toRgb(nes8[3])#E04113
green = toRgb(nes8[4])#32A75C
blue = toRgb(nes8[5])#1AC1FE
yellow = toRgb(nes8[6])#FDD156
white = toRgb(nes8[7])#FCF8EA
enumPico8 : Rgba

A 16-color palette used by the PICO-8. Link: https://lospec.com/palette-list/pico-8

black = toRgb(pico8[0])#000000
navy = toRgb(pico8[1])#1D2B53
maroon = toRgb(pico8[2])#7E2553
darkGreen = toRgb(pico8[3])#008751
brown = toRgb(pico8[4])#AB5236
darkGray = toRgb(pico8[5])#5F574F
lightGray = toRgb(pico8[6])#C2C3C7
white = toRgb(pico8[7])#FFF1E8
red = toRgb(pico8[8])#FF004D
orange = toRgb(pico8[9])#FFA300
yellow = toRgb(pico8[10])#FFEC27
lightGreen = toRgb(pico8[11])#00E436
blue = toRgb(pico8[12])#29ADFF
purple = toRgb(pico8[13])#83769C
pink = toRgb(pico8[14])#FF77A8
peach = toRgb(pico8[15])#FFCCAA
enumFlip : ubyte

Flipping orientations.

noneNo flipping.
xFlipped along the X-axis.
yFlipped along the Y-axis.
xyFlipped along both X and Y axes.
structTile

A tile with a texture atlas id, size, and position.

Fields
short width
short height
short id
Flip flip
byte idOffset
Vec2 position
Methods
float x() @safe nothrow @nogc @trusted refReturns a reference to the x component of the tile position.
float y() @safe nothrow @nogc @trusted refReturns a reference to the y component of the tile position.
Sz row(Sz colCount) @safe nothrow @nogcReturns the row of the tile in the atlas.
Sz col(Sz colCount) @safe nothrow @nogcReturns the column of the tile in the atlas.
Vec2 size() @safe nothrow @nogcReturns the size of the tile as a 2D vector.
Rect area() @safe nothrow @nogcReturns the bounding rectangle of the tile.
Rect textureArea(Sz colCount) @safe nothrow @nogcReturns the rectangle of the tile in the texture atlas.
bool isEmpty() @safe nothrow @nogcReturns true if the tile has no valid id.
bool hasId() @safe nothrow @nogcReturns true if the tile has a valid id.
bool hasSize() @safe nothrow @nogcReturns true if the tile has a non-zero size.
bool hasIdAndSize() @safe nothrow @nogcReturns true if the tile has a valid id and a non-zero size.
bool hasIntersection(Rect otherArea) @safe nothrow @nogcReturns true if the tile area intersects with the given rectangle.
bool hasIntersection(Tile otherTile) @safe nothrow @nogcReturns true if the tile area intersects with another tile.
Rect intersection(Rect otherArea) @safe nothrow @nogcReturns the intersection rectangle of the tile area and the given rectangle.
Rect intersection(Tile otherTile) @safe nothrow @nogcReturns the intersection rectangle of the tile area and another tile.
Rect merger(Rect otherArea) @safe nothrow @nogcReturns the bounding rectangle of the tile area and the given rectangle.
Rect merger(Tile otherTile) @safe nothrow @nogcReturns the bounding rectangle of the tile area and another tile.
void followPosition(Vec2 target, float delta) @safe nothrow @nogcMoves the tile to follow the target position at the specified speed.
void followPositionWithSlowdown(Vec2 target, float delta, float slowdown) @safe nothrow @nogcMoves the tile to follow the target position with gradual slowdown.
Constructors
this(short width, short height, short id, Vec2 position = Vec2())Constructs a tile with the given size, id, and position.
this(short width, short height, short id, float x, float y)Constructs a tile with the given size, id, and position components.
structGTileMap(Sz N)

A generic tile map. N is the maximum layer row or column size.

Fields
maxLayerRowColCountMaximum layer row or column size.
maxLayerCapacityMaximum layer size.
extraTileCountExtra tile padding added when computing visible tile ranges.
TileMapLayers layers
Sz rowCount
Sz colCount
short tileWidth
short tileHeight
Vec2 position
Methods
short opIndex(Sz row, Sz col, Sz layerId = 0) @nogc @safe nothrow @trusted refReturns a reference to the tile id at the given row, column, and layer.
short opIndex(IVec2 position, Sz layerId = 0) @nogc @safe nothrow refReturns a reference to the tile id at the given grid position and layer.
void opIndexAssign(short rhs, Sz row, Sz col, Sz layerId = 0) @nogc @safe nothrow @trustedSets the tile id at the given row, column, and layer.
void opIndexAssign(short rhs, IVec2 position, Sz layerId = 0) @nogc @safe nothrowSets the tile id at the given grid position and layer.
void opIndexOpAssign(IStr op)(T rhs, Sz row, Sz col, Sz layerId = 0) @nogc @safe nothrow @trustedApplies a compound assignment operator to the tile id at the given row, column, and layer.
void opIndexOpAssign(IStr op)(T rhs, IVec2 position, Sz layerId = 0) @nogc @safe nothrowApplies a compound assignment operator to the tile id at the given grid position and layer.
float x() @nogc @safe nothrow @trusted refReturns a reference to the x component of the map position.
float y() @nogc @safe nothrow @trusted refReturns a reference to the y component of the map position.
int width() @nogc @safe nothrowReturns the total pixel width of the active map area.
int height() @nogc @safe nothrowReturns the total pixel height of the active map area.
Vec2 size() @nogc @safe nothrowReturns the total pixel size of the active map area as a 2D vector.
Vec2 tileSize() @nogc @safe nothrowReturns the size of a single tile as a 2D vector.
Sz hardRowCount() @nogc @safe nothrowReturns the allocated row count of the first layer (the hard limit).
Sz hardColCount() @nogc @safe nothrowReturns the allocated column count of the first layer (the hard limit).
bool isEmpty() @nogc @safe nothrowReturns true if the map has no layers.
bool has(Sz row, Sz col) @nogc @safe nothrowReturns true if the given row and column are within the active map bounds.
bool has(IVec2 position) @nogc @safe nothrowReturns true if the given grid position is within the active map bounds.
bool hasTileSize() @nogc @safe nothrowReturns true if the map has a non-zero tile size.
bool hasSize() @nogc @safe nothrowReturns true if the map has a non-zero tile size and a non-zero active area.
Vec2 worldPointAt(int gridX, int gridY) @nogc @safe nothrowReturns the world position of the top-left corner of the tile at the given grid coordinates.
Vec2 worldPointAt(IVec2 gridPoint) @nogc @safe nothrowReturns the world position of the top-left corner of the tile at the given grid point.
IVec2 gridPointAt(float worldX, float worldY) @nogc @safe nothrowReturns the grid coordinates of the tile that contains the given world position.
IVec2 gridPointAt(Vec2 worldPoint) @nogc @safe nothrowReturns the grid coordinates of the tile that contains the given world point.
Fault parseCsv(IStr csv, short newTileWidth, short newTileHeight, Sz layerId = 0, bool isMinZero = false, IStr file = __FILE__, Sz line = __LINE__) @safe nothrowParses a CSV string into the specified layer, using the given tile size. Returns a fault if the CSV is empty, contains invalid values, or exceeds the hard layer bounds. If `isMinZero` is true, tile...
Fault parseCsv(IStr csv, Sz layerId = 0, bool isMinZero = false, IStr file = __FILE__, Sz line = __LINE__) @safe nothrowParses a CSV string into the specified layer using the current tile size. Returns a fault if parsing fails.
Fault parseTmx(IStr tmx, IStr file = __FILE__, Sz line = __LINE__) @trusted @safe nothrowParses a TMX (Tiled XML) map file, extracting tile size and all CSV data layers. Does not support infinite maps. Returns a fault if parsing fails.
void resizeHard(Sz newHardRowCount, Sz newHardColCount, IStr file = __FILE__, Sz line = __LINE__) @safe nothrowAllocates or resizes all layers to the given hard row and column counts. Clamps to `maxLayerRowColCount`. Creates a default layer if the map is empty.
void free(IStr file = __FILE__, Sz line = __LINE__) @safe nothrowFrees all layers and associated memory.
void resize(Sz newRowCount, Sz newColCount) @safe nothrow @nogcSets the active row and column count without reallocating. Asserts if either value exceeds the hard limit.
void resizeTileSize(short newTileWidth, short newTileHeight) @safe nothrow @nogcSets the tile size in pixels.
void clear() @safe nothrow @nogcFills all layers with the empty tile id (-1).
void clear(Sz layerId) @safe nothrow @nogcFills the specified layer with the empty tile id (-1).
void ignoreLeak() @safe nothrow @nogcMarks all layers as ignored for leak detection purposes.
void followPosition(Vec2 target, float delta) @safe nothrow @nogcMoves the map to follow the target position at the specified speed.
void followPositionWithSlowdown(Vec2 target, float delta, float slowdown) @safe nothrow @nogcMoves the map to follow the target position with gradual slowdown.
auto gridPoints(Vec2 topLeftViewPoint, Vec2 bottomRightViewPoint) @safe nothrow @nogcReturns a lazy range of grid points visible within the given view corners. Includes one extra tile of padding on the far edges via `extraTileCount`.
auto gridPoints(Rect viewArea) @safe nothrow @nogcReturns a lazy range of grid points visible within the given view rectangle.
auto tiles(Vec2 topLeftViewPoint, Vec2 bottomRightViewPoint, Sz layerId = 0) @safe nothrow @nogcReturns a lazy range of `Tile` values visible within the given view corners on the specified layer. Each tile carries its size, id, and world-space position. Includes one extra tile of padding on t...
auto tiles(Rect viewArea, Sz layerId = 0) @safe nothrow @nogcReturns a lazy range of `Tile` values visible within the given view rectangle on the specified layer.
Constructors
this(Sz rowCount, Sz colCount, short tileWidth, short tileHeight, IStr file = __FILE__, Sz line = __LINE__)Constructs a tile map with the given row and column count and tile size.
this(short tileWidth, short tileHeight, IStr file = __FILE__, Sz line = __LINE__)Constructs a tile map with the maximum layer size and the given tile size.
aliasTileMap = GTileMap!128

A tile map.

A single sprite animation, defined by its position in an atlas and playback settings.

Fields
ubyte frameRow
ubyte frameCount
ubyte frameSpeed
bool canRepeat

A sprite animation group that picks between 2 animations based on a direction angle.

Fields
ubyte[2] frameRows
ubyte frameCount
ubyte frameSpeed
bool canRepeat
angleStepThe angle step in degrees used to snap the input angle.
Methods
SpriteAnimation pick(float angle) @safe nothrow @nogcPicks an animation based on the given angle in degrees.

A sprite animation group that picks between 4 animations based on a direction angle.

Fields
ubyte[4] frameRows
ubyte frameCount
ubyte frameSpeed
bool canRepeat
angleStepThe angle step in degrees used to snap the input angle.
Methods
SpriteAnimation pick(float angle) @safe nothrow @nogcPicks an animation based on the given angle in degrees.

A sprite animation group that picks between 8 animations based on a direction angle.

Fields
ubyte[8] frameRows
ubyte frameCount
ubyte frameSpeed
bool canRepeat
angleStepThe angle step in degrees used to snap the input angle.
Methods
SpriteAnimation pick(float angle) @safe nothrow @nogcPicks an animation based on the given angle in degrees.

A sprite animation group that picks between 16 animations based on a direction angle.

Fields
ubyte[16] frameRows
ubyte frameCount
ubyte frameSpeed
bool canRepeat
angleStepThe angle step in degrees used to snap the input angle.
Methods
SpriteAnimation pick(float angle) @safe nothrow @nogcPicks an animation based on the given angle in degrees.
structSprite

A sprite with support for animation, positioning, and movement.

Fields
short width
short height
ushort atlasLeft
ushort atlasTop
float frameProgress
bool isPaused
SpriteAnimation animation
Vec2 position
Hook hook
Flip flip
Methods
float x() @safe nothrow @nogc @trusted refReturns a reference to the x component of the sprite position.
float y() @safe nothrow @nogc @trusted refReturns a reference to the y component of the sprite position.
Vec2 size() @safe nothrow @nogcReturns the size of the sprite as a 2D vector.
Rect area() @safe nothrow @nogcReturns the bounding rectangle of the sprite, adjusted by the hook.
bool hasSize() @safe nothrow @nogcReturns true if the sprite has a non-zero size.
bool isActive() @safe nothrow @nogcReturns true if the sprite is currently active (running).
bool hasAnimation() @safe nothrow @nogcReturns true if the sprite has an animation assigned.
bool hasFirstFrame() @safe nothrow @nogcReturns true if the sprite is on the first animation frame.
bool hasLastFrame() @safe nothrow @nogcReturns true if the sprite is on the last animation frame.
bool hasFirstFrameProgress() @safe nothrow @nogcReturns true if the sprite is on the first animation frame progress.
bool hasLastFrameProgress() @safe nothrow @nogcReturns true if the sprite is on the last animation frame progress.
int frame() @safe nothrow @nogcReturns the current animation frame of the sprite.
void reset(int resetFrame = 0) @safe nothrow @nogcResets the animation frame of the sprite.
void play(SpriteAnimation newAnimation, bool canKeepProgress = false) @safe nothrow @nogcStarts playing a new animation, optionally preserving current frame progress.
void stop() @safe nothrow @nogcStops the current animation of the sprite.
void pause() @safe nothrow @nogcPauses the current animation of the sprite.
void resume() @safe nothrow @nogcResumes the current animation of the sprite.
void toggleIsPaused() @safe nothrow @nogcToggles the paused state of the sprite.
void update(float dt) @safe nothrow @nogcUpdates the state of the sprite.
void followPosition(Vec2 target, float delta) @safe nothrow @nogcMoves the sprite to follow the target position at the specified speed.
void followPositionWithSlowdown(Vec2 target, float delta, float slowdown) @safe nothrow @nogcMoves the sprite to follow the target position with gradual slowdown.
Constructors
this(short width, short height, ushort atlasLeft, ushort atlasTop, Vec2 position = Vec2(), Hook hook = Hook.topLeft)Initializes the sprite with the specified size, atlas position, and optional world position.
this(short width, short height, ushort atlasLeft, ushort atlasTop, float x, float y, Hook hook = Hook.topLeft)Initializes the sprite with the specified size, atlas position, and world position.
this(short width, short height, ushort atlasLeft, ushort atlasTop, Hook hook)Initializes the sprite with the specified size, atlas position, and world position.

How to draw a sprite stack layer.

pixelRowLayersThis can be used to draw walls, or things that are 2D.
goxelLayersThis can be used to draw stacks from Goxel.
magicaVoxelLayersThis can be used to draw stacks from Magica Voxel.

A sprite stack.

Fields
ubyte width
ubyte height
ushort atlasLeft
ushort atlasTop
ubyte layerCount
Vec2 position
float rotation

A helper for changing the color of sprite stack layers.

Fields
Vec3 floorColor
Vec3 ceilingColor
float minFactor
float progressRange
bool isActive
Methods
Rgba makeColor(float lightingProgress) @safe nothrow @nogcReturns a new color. Value `lightingProgress` should be between 0.0 and 1.0 (inclusive).
Rgba makeColor(uint layer, uint layerCount) @safe nothrow @nogcReturns a new color. The lighting progress is `layer / layerCount` for this function.
Rgba makeColorIfIsActive(float lightingProgress) @safe nothrow @nogcReturns a new color. Value `lightingProgress` should be between 0.0 and 1.0 (inclusive).
Rgba makeColorIfIsActive(uint layer, uint layerCount) @safe nothrow @nogcReturns a new color. The lighting progress is `layer / layerCount` for this function.
structGTimer(alias elapsedTickTimeFunc)

A generic timer with pause/resume and repeat support. The elapsedTickTimeFunc alias must be a function that returns a float or double value. That value should be the elapsed time at the start of the current tick.

Fields
float duration
float pauseTime
float startTime
float stopTimeElapsedTimeBuffer
bool canRepeat
Methods
bool isPaused() @safe nothrow @nogcReturns true if the timer is currently paused.
bool isActive() @safe nothrow @nogcReturns true if the timer is currently active (running).
bool hasStarted() @safe nothrow @nogcReturns true if the timer has just started.
bool hasStopped() @safe nothrow @nogcReturns true if the timer has just stopped.
void start(float newDuration, bool newCanRepeat) @safe nothrow @nogcStarts the timer with new duration and repeat behavior.
void start(float newDuration = - 1.0f) @safe nothrow @nogcStarts the timer with an optional new duration.
void stop() @safe nothrow @nogcStops the timer and records the time at which it stopped.
void toggleIsActive() @safe nothrow @nogcToggles the active state of the timer.
void pause() @safe nothrow @nogcPauses the time.
void resume() @safe nothrow @nogcResumes the timer from the paused state.
void toggleIsPaused() @safe nothrow @nogcToggles the paused state of the timer.
float time() @safe nothrow @nogcReturns the current time of the timer and handles stop/repeat logic.
float timeLeft() @safe nothrow @nogcReturns the remaining time of the timer and handles stop/repeat logic.
float timeLeftOrZero() @safe nothrow @nogcReturns the remaining time, or zero if inactive.
void setTime(float newTime) @safe nothrow @nogcSets the current time of the timer. If the given value is non-zero, the timer becomes active.
float progress() @safe nothrow @nogcReturns the current progress (between 0.0 to 1.0).
float progressLeft() @safe nothrow @nogcReturns the remaining progress (between 0.0 to 1.0).
float progressLeftOrZero() @safe nothrow @nogcReturns the remaining progress (between 0.0 to 1.0), or zero if inactive.
void setProgress(float value) @safe nothrow @nogcSets the progress to a specific value (between 0.0 to 1.0).
void setProgressLeft(float value) @safe nothrow @nogcSets the remaining progress to a specific value (between 0.0 to 1.0).
Constructors
this(float duration, bool canRepeat = false)Initializes the timer with the specified duration and repeat behavior.
enumStoryLineKind : ubyte

The kind of a story line.

empty = ' 'Not a line.
comment = '#'A comment.
label = '*'A label. Can be used to jump to a line.
text = '|'A line that just has text.
pause = '.'A line that ends the story.
menu = '^'A line that can provide user input.
expression = '$'A line that can execute story expressions.
procedure = '!'A line that can execute D functions.
enumStoryOp : ubyte

An operation in the story expression language.

ADD = '+'
SUB = '-'
MUL = '*'
DIV = '/'
MOD = '%'
AND = '&'
OR = '|'
LESS = '<'
GREATER = '>'
EQUAL = '='
NOT = '!'
POP = '~'
CLEAR
SWAP
COPY
COPYN
RANGE
IF
ELSE
THEN
CAT
SAME
WORD
NUMBER
LINE
DEBUG
LINEAR
ASSERT
END
ECHO
ECHON
LEAK
LEAKN
HERE
GET
GETN
SET
INIT
DROP
DROPN
INC
DEC
INCN
DECN
TOG
MENU
LOOP
SKIP
JUMP
aliasStoryWord = char[24]

A fixed-size word in the story expression language.

aliasStoryNumber = int

A number in the story expression language.

The underlying data of a story value.

A value in the story expression language, either a word or a number.

Fields
Methods
IStr toStr() @trusted @safe nothrow @nogc

A named variable in the story expression language.

Fields

A start and end index pair used to identify ranges in the story.

Fields
uint a
uint b
structStory

A story script with its associated state for parsing and execution.

Fields
LStr script
StoryNumber lineIndex
StoryNumber nextLabelIndex
StoryNumber previousMenuResult
StoryNumber faultPrepareIndex
StoryOp faultOp
Sz faultTokenPosition
bool debugMode
bool linearMode
EchonFunc echonFunc
Methods
Fault prepare(IStr file = __FILE__, Sz line = __LINE__) @trusted @safe nothrow
Fault parse(IStr text, IStr file = __FILE__, Sz line = __LINE__) @safe nothrow
Fault execute(IStr expression, IStr file = __FILE__, Sz line = __LINE__) @trusted @safe nothrow
Fault update(IStr file = __FILE__, Sz line = __LINE__) @safe nothrow
Fault select(Sz i, IStr file = __FILE__, Sz line = __LINE__) @safe nothrow
void reserve(Sz capacity, IStr file = __FILE__, Sz line = __LINE__) @safe nothrow
void free(IStr file = __FILE__, Sz line = __LINE__) @safe nothrow
void echon(IStr[] text...) @safe nothrow @nogc
IStr opIndex(Sz i) @safe nothrow @nogc
StoryNumber lineCount() @safe nothrow @nogc
bool hasKind(StoryLineKind kind) @safe nothrow @nogc
bool hasEnd() @safe nothrow @nogc
bool hasPause() @safe nothrow @nogc
bool hasProcedure() @safe nothrow @nogc
bool hasMenu() @safe nothrow @nogc
bool hasText() @safe nothrow @nogc
IStr[] procedure() @safe nothrow @nogc
IStr[] menu() @safe nothrow @nogc
IStr text() @safe nothrow @nogc
Fault throwOpFault(StoryOp op, Sz position) @safe nothrow @nogc
StoryNumber findVariable(StoryWord name) @safe nothrow @nogc
StoryNumber findLabel(StoryWord name) @safe nothrow @nogc
void setNextLabelIndex(StoryNumber value) @safe nothrow @nogc
void setLineIndex(StoryNumber value) @safe nothrow @nogc
void resetLineIndex() @safe nothrow @nogc
void jumpLineIndex(StoryNumber labelIndex) @safe nothrow @nogc
void ignoreLeak() @safe nothrow @nogc
structGBoxIdPair(T)
Fields
T x
T y
aliasBoxId = ushort

A generic box ID.

aliasBoxFlags = ushort

Generic box flags.

aliasBoxUnionIdGroup = FixedList!(BoxUnionId, boxFixedCapacity)

An box actor ID.

structBoxWallId

A box wall ID.

A generic box ID pair.

A box actor ID pair.

A wall actor ID pair.

aliasBoxIdBuffer = FixedList!(BoxId, boxFixedCapacity)
aliasBoxActorIdBuffer = FixedList!(BoxActorId, boxFixedCapacity)
aliasBoxWallIdBuffer = FixedList!(BoxWallId, boxFixedCapacity)
enumBoxUnionType : ubyte
wall = 0x0
actor = 0x1

The flags of a box.

none = 0x0
isPassable = 0x1
isRiding = 0x2
enumBoxSide : ubyte

The side of a box.

none
top
left
right
bottom
aliasBox = SRect

The area of a box.

The properties of a box.

Fields
Vec2 remainder
BoxFlags flags
BoxSide side
structBoxData

The data of a box.

Fields
Box area
BoxProperties properties
structBoxMover

A helper for mobing things around a world.

Fields
Vec2 direction
Vec2 velocity
float speed
float acceleration
float gravity
float jump
float gravityFallFactor
float decelerationFactor
Methods
bool isSmooth() @safe nothrow @nogc
bool isTopDown() @safe nothrow @nogc
Vec2 move() @safe nothrow @nogc
Vec2 move(Vec2 newDirection) @safe nothrow @nogc
Constructors
this(float speed, float acceleration = 0.0f, float gravity = 0.0f, float jump = 0.0f)
structBoxWorld

A box world.

Fields
List!BoxData actors
BoxIdBuffer collisionIdBuffer
BoxIdBuffer squishedIdBuffer
int gridTileWidth
int gridTileHeight
Methods
BoxWallId pushWall(Box box, BoxSide side = BoxSide.none, IStr file = __FILE__, Sz line = __LINE__) @safe nothrow
BoxActorId pushActor(Box box, BoxSide side = BoxSide.none, IStr file = __FILE__, Sz line = __LINE__) @safe nothrow
Fault parseWallsCsv(IStr csv, int tileWidth, int tileHeight, IStr file = __FILE__, Sz line = __LINE__) @safe nothrow
void reserve(Sz capacity, IStr file = __FILE__, Sz line = __LINE__) @safe nothrow
void enableGrid(Sz rowCount, Sz colCount, int tileWidth, int tileHeight, IStr file = __FILE__, Sz line = __LINE__) @safe nothrow
void free(IStr file = __FILE__, Sz line = __LINE__) @safe nothrow
void disableGrid() @safe nothrow @nogc
void removeWall(BoxWallId id) @safe nothrow @nogc
void removeActor(BoxActorId id) @safe nothrow @nogc
void clearWalls() @safe nothrow @nogc
void clearActors() @safe nothrow @nogc
bool isGridPointValid(IVec2 point) @safe nothrow @nogc
IVec2 gridPoint(Box box) @safe nothrow @nogc
Box wall(BoxWallId id) ref @safe nothrow @nogc
BoxProperties wallProperties(BoxWallId id) ref @safe nothrow @nogc
Box actor(BoxActorId id) ref @safe nothrow @nogc
BoxProperties actorProperties(BoxActorId id) ref @safe nothrow @nogc
BoxWallId[] wallCollisions(Box box, bool canStopAtFirst = false) @trusted @safe nothrow @nogc
BoxWallId hasWallCollision(Box box) @safe nothrow @nogc
BoxWallId hasWallCollision(BoxWallId id) @safe nothrow @nogc
BoxWallId hasWallCollision(BoxWallId id1, BoxWallId id2) @safe nothrow @nogc
BoxActorId[] actorCollisions(Box box, bool canStopAtFirst = false) @trusted @safe nothrow @nogc
BoxActorId hasActorCollision(Box box) @safe nothrow @nogc
BoxActorId hasActorCollision(BoxActorId id) @safe nothrow @nogc
BoxActorId hasActorCollision(BoxActorId id1, BoxActorId id2) @safe nothrow @nogc
BoxWallId moveActorX(BoxActorId id, float amount) @safe nothrow @nogc
BoxWallId moveActorXTo(BoxActorId id, float to, float amount) @safe nothrow @nogc
BoxWallId moveActorXToWithSlowdown(BoxActorId id, float to, float amount, float slowdown) @safe nothrow @nogc
BoxWallId moveActorY(BoxActorId id, float amount) @safe nothrow @nogc
BoxWallId moveActorYTo(BoxActorId id, float to, float amount) @safe nothrow @nogc
BoxWallId moveActorYToWithSlowdown(BoxActorId id, float to, float amount, float slowdown) @safe nothrow @nogc
BoxWallIdPair moveActor(BoxActorId id, Vec2 amount) @safe nothrow @nogc
BoxWallIdPair moveActorTo(BoxActorId id, Vec2 to, Vec2 amount) @safe nothrow @nogc
BoxWallIdPair moveActorToWithSlowdown(BoxActorId id, Vec2 to, Vec2 amount, float slowdown) @safe nothrow @nogc
BoxActorId[] moveWallX(BoxWallId id, float amount) @safe nothrow @nogc
BoxActorId[] moveWallXTo(BoxWallId id, float to, float amount) @safe nothrow @nogc
BoxActorId[] moveWallXToWithSlowdown(BoxWallId id, float to, float amount, float slowdown) @safe nothrow @nogc
BoxActorId[] moveWallY(BoxWallId id, float amount) @safe nothrow @nogc
BoxActorId[] moveWallYTo(BoxWallId id, float to, float amount) @safe nothrow @nogc
BoxActorId[] moveWallYToWithSlowdown(BoxWallId id, float to, float amount, float slowdown) @safe nothrow @nogc
BoxActorId[] moveWall(BoxWallId id, Vec2 amount) @trusted @safe nothrow @nogc
BoxActorId[] moveWallTo(BoxWallId id, Vec2 to, Vec2 amount) @safe nothrow @nogc
BoxActorId[] moveWallToWithSlowdown(BoxWallId id, Vec2 to, Vec2 amount, float slowdown) @safe nothrow @nogc
void clear() @safe nothrow @nogc
void ignoreLeak() @safe nothrow @nogc
Constructors
this(Sz capacity, IStr file = __FILE__, Sz line = __LINE__)
structSlicePart

A part of a 9-slice.

Fields
IRect source
IRect target
IVec2 tileCount
bool isCorner
bool canTile

The parts of a 9-slice.

Information about the viewport, including its drawing region and size constraints.

Fields
Rect area
Vec2 logicalSize
Vec2 physicalSize
float scale
Methods
void update(Vec2 newPhysicalSize, Vec2 newLogicalSize, bool isSizeLocked, bool isScalingPixelPerfect) @safe nothrow @nogcUpdate the info based on the given sizes.

Functions 7

fnSliceParts computeSliceParts(IRect source, IRect target, Margin margin) @safe nothrow @nogc
fnPalette!N csvRowToPalette(Sz N)(IStr csv, Sz row = 0, Sz startCol = 0) @safe nothrow @nogcConverts a CSV row to a color palette. If the row can't be parsed, then the first value of the palette will be blank.
fnbool isMaybeStoryOp(IStr value) @safe nothrow @nogc
fnbool isMaybeStoryNumber(IStr value) @safe nothrow @nogc
fnbool isMaybeStoryWord(IStr value) @safe nothrow @nogc
fnMaybe!StoryLineKind toStoryLineKind(char from) @safe nothrow @nogc
fnMaybe!StoryOp toStoryOp(IStr from) @safe nothrow @nogc

Variables 28

enumvardefaultStoryFixedListCapacity = 16
enumvarblank = Rgba()

#00000000

enumvarblack = Rgba(0)

#000000FF

enumvarwhite = Rgba(255)

#FFFFFFFF

enumvarred = Rgba(255, 0, 0)

#FF0000FF

enumvargreen = Rgba(0, 255, 0)

#00FF00FF

enumvarblue = Rgba(0, 0, 255)

#0000FFFF

enumvaryellow = Rgba(255, 255, 0)

#FFFF00FF

enumvarmagenta = Rgba(255, 0, 255)

#FF00FFFF

enumvarcyan = Rgba(0, 255, 255)

#00FFFFFF

enumvarpink = Rgba(255, 192, 204)

#FFC0CCFF

enumvarorange = Rgba(255, 165, 0)

#FFA500FF

enumvarbeige = Rgba(240, 235, 210)

#F0EBD2FF

enumvarbrown = Rgba(165, 72, 42)

#A5482AFF

enumvarmaroon = Rgba(128, 0, 0)

#800000FF

enumvargray1 = Rgba(32, 32, 32)

#202020FF

enumvargray2 = Rgba(96, 96, 96)

#606060FF

enumvargray3 = Rgba(159, 159, 159)

#9F9F9FFF

enumvargray4 = Rgba(223, 223, 223)

#DFDFDFFF

enumvargray = gray2

#606060FF

varHexPalette!2 wisp2

A 2-color palette inspired by the Playdate. Link: https://kapendev.itch.io/will-of-the-hair-wisp

varHexPalette!4 gb4

A 4-color palette inspired by the Game Boy. Link: https://lospec.com/palette-list/2-bit-matrix

varHexPalette!8 nes8

An 8-color palette inspired by the NES. Link: https://lospec.com/palette-list/mf-8

varHexPalette!16 pico8

A 16-color palette used by the PICO-8. Link: https://lospec.com/palette-list/pico-8

enumvarboxNoneId = 0
enumvarboxUnionTypeBit = (cast(BoxUnionId) 1) << (BoxUnionId.sizeof * 8 - 1)
enumvarboxErrorMessage = "Box is invalid or was never assigned."
enumvarboxFixedCapacity = 256