Skip to content

ScreenText beta ​

Interface of @v12-engine/client/common

ts
export interface ScreenText

Text that floats in the view, like the gold for a kill

Members ​

background ​

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

A box behind it

color ​

ts
color: string;

CSS color of the text

draw ​

ts
draw?: (ctx: CanvasRenderingContext2D) => void;

Drawn by the game instead: the context moved to where it stands, scaled, its opacity set

font ​

ts
font?: string;

A CSS font of its own (700 17px 'Alegreya Sans'): the overlay's at size when left out

icon ​

ts
icon?: string;

A picture before it: an address

opacity ​

ts
opacity: number;

0..1

scale ​

ts
scale?: number;

Times its size, around where it stands: 1 when left out

size ​

ts
size?: number;

Pixels high, for what is not the usual size: the name above a hero is smaller

stroke ​

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

Its outline: black 3 pixels when left out, none for false

text ​

ts
text: string;

The words drawn

x ​

ts
x: number;

Distance of the text from the canvas's left edge, in CSS pixels

y ​

ts
y: number;

Distance of the text from the canvas's top edge, in CSS pixels