Skip to content

FloatDef beta ​

Interface of @v12-engine/client

ts
export interface FloatDef

A floating word or number (GameView.hud.floats, client.floats.show): what it says, how it looks and moves, for how long, and how several of it become one

Members ​

at ​

ts
at?: 'head' | 'chest' | 'feet';

Where it starts on the entity: over its head (default), its middle, its feet; a float with no entity, at its point

fade ​

ts
fade?: 'out' | 'shrink' | 'none';

How it goes at the end: fading out (default), shrinking away, or not at all

follow ​

ts
follow?: boolean;

With its entity as it moves (default), or where it started

merge ​

ts
merge?: FloatMerge;

Several of it as one: none when left out (each float its own)

most ​

ts
most?: number;

At most so many of this def up at once, the oldest let go: none when left out

motion ​

ts
motion?: FloatMotion | readonly FloatMotion[];

How it moves: up 1.5 world units when left out

offset ​

ts
offset?: {
        x?: number;
        y?: number;
    };

Screen pixels from there, to the right and down

render ​

ts
render?: 'canvas' | 'dom' | 'world' | FloatDraw;

How it is drawn: on the overlay canvas with the plates (default), as an element of the page over the world, in the world itself ('world': a plane facing the camera, hidden by what stands before it, fogged by the scene's fog, lit where its style says, smaller as it is further; a number counting up drawn again ten times a second at most), or by the game's own drawing on the overlay

seconds ​

ts
seconds?: FloatValue<number>;

Seconds it lives: 1.4 when left out

spread ​

ts
spread?: number;

Pixels: a random sideways start within so much, so that floats of one entity do not cover each other

style ​

ts
style?: FloatStyle;

How it looks: font, size, colour, outline, a box, an icon

text ​

ts
text?: FloatValue<string>;

The words: a string, or a function of what is floated; the amount (42) when left out. A string fills in what is floated where it names it in braces: {amount} (the number, whole), {+amount} (with its sign: +12, -35), and any of the input's params ({name}, {level}, {resource}): '-{amount}', 'Level {amount}'

within ​

ts
within?: number;

Cells from what the camera looks at past which it is not put up: always when left out