Skip to content

FloatStyle beta ​

Interface of @v12-engine/client

ts
export interface FloatStyle

How a float looks: its font, size, colour, outline, a box behind it, an icon before it

Members ​

background ​

ts
background?: {
        color: string;
        padding?: number;
        radius?: number;
    } | false;

A box behind the words: none when left out

color ​

ts
color?: FloatValue<string>;

CSS colour: white when left out

font ​

ts
font?: string;

A CSS font family ('"Cinzel", serif'): the overlay's when left out. The size is size

icon ​

ts
icon?: FloatValue<string | undefined>;

A picture before the words: a path in the game's files

lit ​

ts
lit?: boolean;

Lit by the scene's light, darker at night and in shade, for a float drawn in the world (render: 'world'): its own colours whatever the light when left out

opacity ​

ts
opacity?: number;

0 to 1, times the fading: 1 when left out

size ​

ts
size?: FloatValue<number>;

Pixels (screen pixels at a pixel ratio of 1): 17 when left out. In the world (render: 'world'), 36 pixels are a world unit (FLOAT_WORLD_PIXELS), and it is smaller as it is further

stroke ​

ts
stroke?: {
        color?: string;
        width?: number;
    } | false;

The outline: a colour and a width in pixels, black 3 when left out; false for none

weight ​

ts
weight?: number | 'normal' | 'bold';

A CSS font weight: 700 when left out