The pack
horrorArt
function horrorArt(): Pack<{ horrorArt: HorrorArtApi }>
The horror-art pack: game.horrorArt, ready-made pixel-art figures (a stalker in four poses, an apparition, a
runner, a mirror figure, a shade, a hooded monk, a face) and props (a fuse, a battery, a phone, a radio, an oil
flask, a book, bones, a bell) for first-person horror. No options.
Helpers
findHorrorArt
function findHorrorArt(name: string): string | null
The entry a name should wear; see HorrorArtApi.find.
HORROR_ART
const HORROR_ART: Readonly<Record<string, HorrorArtEntry>>
Every picture as 256-colour PNGs in base64, standing on the bottom edge of its frames, by id.
horrorArtPose
function horrorArtPose(info: HorrorArtInfo, pose: string): number
A pose's frame; see HorrorArtApi.pose.
Types
HorrorArtApi
interface HorrorArtApi
game.horrorArt.
readonly names: readonly string[]— Every entry's id.find(name: string): string | null— The entry a name should wear: the id as it is, else a guess from its words ('figure'and'ghost'the apparition,'mirror-figure'the mirror figure,'monster'the stalker,'object'the book,'skull'the bones,'oil'the flask,'cell'the battery). Null when nothing fits.load(names: ReadonlyArray<string | { id: string; art?: string }>, options?: HorrorArtLoadOptions): Promise<Record<string, HorrorArtInfo>>— Paint pictures into the atlas: each name (or{ id, art }to choose the entry) gets its poses as frames ofprefix + id. Names nothing fits are left out. Async, because a browser decodes the pictures; headless, the frames exist with the right count and size but blank. Throws on a scale out of range or an unknownart.pose(info: HorrorArtInfo, pose: string): number— A pose's frame withininfo.key, or the first frame when it has no such pose.
HorrorArtEntry
interface HorrorArtEntry
One entry's pictures, as the pack ships them.
readonly kind: HorrorArtKind— A figure (its poses at one scale, standing on the bottom edge) or a prop (fitted into a square, standing on its bottom edge).readonly size: readonly [number, number]— Each frame's size in pixels,[width, height]; every pose of an entry has the same.readonly height: number— The world height, in units, the whole frame is meant to be drawn at: a suggestion (a figure's own height may differ).readonly frames: Readonly<Record<string, string>>— The poses, by name in order, each a 256-colour PNG in base64.
HorrorArtInfo
interface HorrorArtInfo
A picture as it was painted: its key, its size and which frame is which pose.
readonly id: string— The name it was painted for.readonly art: string— The entry it wears.readonly kind: HorrorArtKind—'figure'or'prop'.readonly key: string— Its atlas key.readonly width: number— One frame's painted size, units (the shipped size in pixels timesscale).readonly height: number— One frame's painted size, units.readonly aspect: number— Width over height: a billboardhunits tall ish * aspectwide.readonly worldHeight: number— The world height the whole frame is meant to be drawn at, units (the entry's suggestion).readonly poses: Readonly<Record<string, number>>— Each pose's frame withinkey, by name; withmirrored, each also as<pose>-flip, facing the other way.readonly frames: number— Frames painted underkey.
HorrorArtKind
type HorrorArtKind = 'figure' | 'prop'
What a picture is: a figure standing on the bottom edge of its frames, or a prop fitted into a square.
HorrorArtLoadOptions
interface HorrorArtLoadOptions
Options for load.
prefix?: string— Atlas keys are this plus the name. Default'ha-'.scale?: number— Painted size per picture pixel, a whole number from 1 to 4. The atlas already paints at twice the density with smoothing off, so 1 keeps pixel art crisp; more only for a figure drawn very large. Big frames at a big scale may not fit an atlas page. Default 1.mirrored?: boolean— Also paint each pose mirrored, as<pose>-flip: a side-on figure walking the other way. Default false.


