FxDef beta
Interface of @v12-engine/client
export interface FxDefAn effect (effects plan A1): a timeline of parts, each starting at seconds in and lasting for seconds or as long as the effect does, with knobs (params) its parts read so it is tuned without being copied. Declared in GameView.fx.defs by name, or played as it is. make in place of parts: the game's own, in code
Members
about
about?: string;What it is, in a line, for whoever picks one
detail
detail?: {
full?: number;
far?: number;
least?: number;
};Its particles by distance, over the system's (FxSystem.detail): all of them nearer than full, least of them from far
extends
extends?: string;Another effect, by name, this one is: its parts, with these knobs over its (what fx.extend makes)
fade
fade?: number;Seconds it fades over when stopped with fade: 0.5 when left out
knobs
knobs?: Readonly<Record<string, KnobInfo>>;What its knobs are, for the editor and the docs (KnobInfo)
length
length?: number;Seconds it lasts. When left out, as long as its parts that end by themselves; for ever (until it is stopped) when one of them never does (particles at a rate with no for: a fire)
loop
loop?: boolean;Plays over and over until it is stopped
make
make?: (context: FxContext) => FxInstance;The game's own effect, in code, in place of parts: drawn with the renderer (FxContext)
offset
offset?: Param<readonly [number, number, number]>;Where it plays from where it is played, in world units, turned and sized with it (up is y): a torch's flame [0, 0.85, 0] over the foot of the torch it is played on. None when left out
params
params?: FxParams;Its knobs with what they are when not given (size: 1, color: '#ff8030')
parts
parts?: readonly FxPart[];Its parts, on its timeline (FxPart)
priority
priority?: number;Which effects go first when there are too many (fxBudget): higher stay. 0 when left out; a big blast that tells the player something 1, smoke from a chimney -1
range
range?: number;How far from what the camera looks at it is still played, in cells: 60 when left out (FxSystem.detail.range)
seed
seed?: number;What its random choices go by, every time it is played: each play of it the same (a preview, a replay, a cinematic's shot), its particles too (those of the CPU's: where each starts and goes, its life, size and colour, for the same frames). Each play its own when left out; a play's own (FxPlay.seed) goes over it
stop
stop?: FxStop;What stopping it does (FxStop): finish when left out
tags
tags?: readonly string[];Words it is found by (fire, magic), besides its name