Skip to content

components/game-hud

GameAccent = "moss" | "ember" | "tide"

The accent a game tints the shared game theme with.


GameThemeProps = Readonly<{ data-theme: "field-guide" | "field-guide-night"; data-game-accent: GameAccent; }>

Theme attributes for any element that hosts game HUD pieces.


GameRegionName = "top-left" | "top-right" | "right" | "bottom" | "bottom-left" | "center"

A region of the game layer, laid over a full-bleed world.


HudTone = "success" | "warning" | "error" | "info"

Semantic bar tones; the theme supplies each colour.


HudBarProps = Omit<HTMLAttributes<HTMLDivElement>>, "children"> > & object

Props accepted by HudBar.

label: string

value: number

max: number

optional tone?: HudTone

optional glyph?: ReactNode


HudPhase = "day" | "dusk" | "night" | "dawn"

The light of the day a clock shows.


PortraitMood = "ok" | "warn" | "bad"

How a portrait’s subject is doing.


MinimapMarkKind = "self" | "ally" | "foe" | "place" | "goal"

What a minimap mark stands for; the theme colours each kind.


MinimapMark = Readonly<{ x: number; y: number; kind: MinimapMarkKind; label: string; }>

One mark on the minimap, in whole grid cells.


GameCardKind = "goal" | "letter" | "dialogue" | "end" | "screen"

What a game card is for; each kind sets its size and voice.


RecipePart = Readonly<{ label: string; glyph: string; have?: number; need?: number; quantity?: number; }>

One ingredient or product of a recipe.

const GameLayer: ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> > & RefAttributes<HTMLDivElement>>>>

Positions HUD regions over the world; the world stays interactive between them.


const GameRegion: ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> > & object & RefAttributes<HTMLDivElement>>>>

One named HUD region; only its children take pointer input.


const GameScrim: ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> > & RefAttributes<HTMLDivElement>>>>

A dimmed stage for title, pause and end screens; it centres one card.


const HudPlate: ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> > & object & RefAttributes<HTMLDivElement>>>>

A floating paper plate drawn in the sprites’ ink line.


const HudBar: ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>>, "children"> > & object & RefAttributes<HTMLDivElement>>>>

A segmented resource bar: health, hunger, noise, hull.


const HudChip: ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLSpanElement>>, "children"> > & object & RefAttributes<HTMLSpanElement>>>>

A counted thing on the HUD: bandages, crowns, round shot.


const HudClock: ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>>, "children"> > & object & RefAttributes<HTMLDivElement>>>>

The game clock: a phase mark, a label, an optional countdown and time.


const Portrait: ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>>, "children"> > & object & RefAttributes<HTMLDivElement>>>>

A person in the portrait strip: their mark, name and what they are doing.


const MinimapPlate: ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLElement>>, "children"> > & object & RefAttributes<HTMLElement>>>>

A small chart of the world: a paper grid with named marks. Names are laid out so none overlap (layoutMinimapLabels); one with no room hides and shows on hover or focus.


const GameCard: ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLElement>>, "title"> > & object & RefAttributes<HTMLElement>>>>

A paper card: goals, letters, dialogue, pause and end screens.


const HudKeys: ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> > & object & RefAttributes<HTMLDivElement>>>>

A row of keycaps: a dock across the bottom or a rail down the side.


const OfferRow: ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>>, "children"> > & object & RefAttributes<HTMLDivElement>>>>

A shop or trade line: what, why, how much, and the act of buying it.


const RecipeRow: ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>>, "children"> > & object & RefAttributes<HTMLDivElement>>>>

A workbench recipe: inputs (short ones marked) become the output.

gameThemeProps(accent?, night?): GameThemeProps

The one game theme: field-guide paper, by day or by night.

GameAccent = "moss"

boolean = false

GameThemeProps


HudNumber(__namedParameters): Element

A readable number in the theme’s numeric font.

string | number

"sm" | "md" = "sm"

Element


GoalLine(__namedParameters): Element

A ticked or open line on a goal card.

boolean

ReactNode

Element


MadeWith(__namedParameters): Element

The quiet credit line on an end card.

Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "children">

Element