[**@fungi.computer/caps**](../README.md) --- [@fungi.computer/caps](../README.md) / components/game-hud # components/game-hud ## Type Aliases ### GameRegionName ```ts type GameRegionName = "top-left" | "top-right" | "right" | "bottom" | "bottom-left" | "center"; ``` A region of the game layer, laid over a full-bleed world. --- ### HudTone ```ts type HudTone = "success" | "warning" | "error" | "info"; ``` Semantic bar tones; the theme supplies each colour. --- ### HudBarProps ```ts type HudBarProps = Omit, "children"> & object; ``` Props accepted by HudBar. #### Type Declaration | Name | Type | | -------- | --------------------- | | `label` | `string` | | `value` | `number` | | `max` | `number` | | `tone?` | [`HudTone`](#hudtone) | | `glyph?` | `ReactNode` | --- ### HudPhase ```ts type HudPhase = "day" | "dusk" | "night" | "dawn"; ``` The light of the day a clock shows. --- ### PortraitMood ```ts type PortraitMood = "ok" | "warn" | "bad"; ``` How a portrait's subject is doing. --- ### MinimapMarkKind ```ts type MinimapMarkKind = "self" | "ally" | "foe" | "place" | "goal"; ``` What a minimap mark stands for; the theme colours each kind. --- ### MinimapMark ```ts type MinimapMark = Readonly<{ x: number; y: number; kind: MinimapMarkKind; label: string; }>; ``` One mark on the minimap, in whole grid cells. --- ### GameCardKind ```ts type GameCardKind = "goal" | "letter" | "dialogue" | "end" | "screen"; ``` What a game card is for; each kind sets its size and voice. --- ### RecipePart ```ts type RecipePart = Readonly<{ label: string; glyph: string; have?: number; need?: number; quantity?: number; }>; ``` One ingredient or product of a recipe. ## Variables ### GameLayer ```ts const GameLayer: ForwardRefExoticComponent< HTMLAttributes & object & RefAttributes >; ``` Positions HUD regions over the world; the world stays interactive between them. --- ### GameRegion ```ts const GameRegion: ForwardRefExoticComponent< HTMLAttributes & object & RefAttributes >; ``` One named HUD region; only its children take pointer input. --- ### GameScrim ```ts const GameScrim: ForwardRefExoticComponent< HTMLAttributes & RefAttributes >; ``` A dimmed stage for title, pause and end screens; it centres one card. --- ### HudPlate ```ts const HudPlate: ForwardRefExoticComponent< HTMLAttributes & object & RefAttributes >; ``` A floating paper plate drawn in the sprites' ink line. --- ### HudBar ```ts const HudBar: ForwardRefExoticComponent< Omit, "children"> & object & RefAttributes >; ``` A segmented resource bar: health, hunger, noise, hull. --- ### HudChip ```ts const HudChip: ForwardRefExoticComponent< Omit, "children"> & object & RefAttributes >; ``` A counted thing on the HUD: bandages, crowns, round shot. --- ### HudClock ```ts const HudClock: ForwardRefExoticComponent< Omit, "children"> & object & RefAttributes >; ``` The game clock: a phase mark, a label, an optional countdown and time. --- ### Portrait ```ts const Portrait: ForwardRefExoticComponent< Omit, "children"> & object & RefAttributes >; ``` A person in the portrait strip: their mark, name and what they are doing. --- ### MinimapPlate ```ts const MinimapPlate: ForwardRefExoticComponent< Omit, "children"> & object & RefAttributes >; ``` 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. --- ### GameCard ```ts const GameCard: ForwardRefExoticComponent< Omit, "title"> & object & RefAttributes >; ``` A paper card: goals, letters, dialogue, pause and end screens. --- ### HudKeys ```ts const HudKeys: ForwardRefExoticComponent< HTMLAttributes & object & RefAttributes >; ``` A row of keycaps: a dock across the bottom or a rail down the side. --- ### OfferRow ```ts const OfferRow: ForwardRefExoticComponent< Omit, "children"> & object & RefAttributes >; ``` A shop or trade line: what, why, how much, and the act of buying it. --- ### RecipeRow ```ts const RecipeRow: ForwardRefExoticComponent< Omit, "children"> & object & RefAttributes >; ``` A workbench recipe: inputs (short ones marked) become the output. ## Functions ### HudNumber() ```ts function HudNumber(__namedParameters): Element; ``` A readable number in the theme's numeric font. #### Parameters | Parameter | Type | | ------------------------- | --------------------------------------------------------------- | | `__namedParameters` | \{ `value`: `string` \| `number`; `size?`: `"sm"` \| `"md"`; \} | | `__namedParameters.value` | `string` \| `number` | | `__namedParameters.size?` | `"sm"` \| `"md"` | #### Returns `Element` --- ### GoalLine() ```ts function GoalLine(__namedParameters): Element; ``` A ticked or open line on a goal card. #### Parameters | Parameter | Type | | ---------------------------- | ------------------------------------------------- | | `__namedParameters` | \{ `done`: `boolean`; `children`: `ReactNode`; \} | | `__namedParameters.done` | `boolean` | | `__namedParameters.children` | `ReactNode` | #### Returns `Element` --- ### MadeWith() ```ts function MadeWith(__namedParameters): Element; ``` The quiet credit line on an end card. #### Parameters | Parameter | Type | | ------------------- | --------------------------------------------------------------------- | | `__namedParameters` | `Omit`\<`AnchorHTMLAttributes`\<`HTMLAnchorElement`\>, `"children"`\> | #### Returns `Element`