FloatDef beta
Interface of @v12-engine/client
export interface FloatDefA 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
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
fade?: 'out' | 'shrink' | 'none';How it goes at the end: fading out (default), shrinking away, or not at all
follow
follow?: boolean;With its entity as it moves (default), or where it started
merge
merge?: FloatMerge;Several of it as one: none when left out (each float its own)
most
most?: number;At most so many of this def up at once, the oldest let go: none when left out
motion
motion?: FloatMotion | readonly FloatMotion[];How it moves: up 1.5 world units when left out
offset
offset?: {
x?: number;
y?: number;
};Screen pixels from there, to the right and down
render
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
seconds?: FloatValue<number>;Seconds it lives: 1.4 when left out
spread
spread?: number;Pixels: a random sideways start within so much, so that floats of one entity do not cover each other
style
style?: FloatStyle;How it looks: font, size, colour, outline, a box, an icon
text
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
within?: number;Cells from what the camera looks at past which it is not put up: always when left out