Skip to content
M2O Scripting APIScripting reference
Data shapeServer APIGenerated

TextLabelOptions

Defined in: server/api.d.ts:4458

A text label’s look and placement. Every key is optional; colours are 0xAARRGGBB numbers, “#RRGGBB[AA]” strings or Colors.

optional align?: "left" | "center" | "right"

Defined in: server/api.d.ts:4537

How lines align with each other. Default “center”.


optional anchor?: "center" | "bottom" | "top"

Defined in: server/api.d.ts:4542

Which part of the text block sits on the point. “bottom” grows upward, as a tag over a head.


optional attachTo?: number | Entity | null

Defined in: server/api.d.ts:4477

Another live entity to follow, or its network id; null or 0 detaches. The label is destroyed with it.


optional background?: boolean | { color?: string | number | Color; padding?: number; radius?: number; } | null

Defined in: server/api.d.ts:4532

A plate behind the text; true is translucent black, 4 px padding and radius.


optional color?: string | number | Color

Defined in: server/api.d.ts:4507

Text colour. Default white.


optional drawDistance?: number

Defined in: server/api.d.ts:4557

World units; the label neither draws nor streams past it. Default 30 metres’ worth.


optional fadeDistance?: number

Defined in: server/api.d.ts:4562

World units where fading starts; 0 starts at 75% of drawDistance.


optional fontSize?: number

Defined in: server/api.d.ts:4487

Pixels, 1-512. Default 16.


optional lineSpacing?: number

Defined in: server/api.d.ts:4547

Line height as a multiple of the size. Default 1.


optional markup?: boolean

Defined in: server/api.d.ts:4467

Parse inline tags: {#RRGGBB} / {#RRGGBBAA} colour, {#} back to color, {b}{/b}, {i}{/i}, {{ for a brace. Default false.


optional maxSize?: number

Defined in: server/api.d.ts:4502

World mode: never larger than this many pixels; 0 = no cap.


optional maxWidth?: number

Defined in: server/api.d.ts:4552

Wraps at spaces past this width, in fontSize pixels. 0 (default) never wraps.


optional minSize?: number

Defined in: server/api.d.ts:4497

World mode: never smaller than this many pixels.


optional occlusion?: boolean

Defined in: server/api.d.ts:4567

Hidden behind world geometry. Default true.


optional offset?: Vector3 | { x: number; y: number; z: number; }

Defined in: server/api.d.ts:4482

Relative to the attached entity; the game decides the reference point (a player’s head, say).


optional opacity?: number

Defined in: server/api.d.ts:4512

0-1, multiplies every colour. Default 1.


optional outline?: boolean | { color?: string | number | Color; width?: number; } | null

Defined in: server/api.d.ts:4522

true is 1 px black; width is at most 4.


optional position?: Vector3 | { x: number; y: number; z: number; }

Defined in: server/api.d.ts:4472

Where the label stands while it is not attached, and returns to when detached.


optional shadow?: boolean | { blur?: number; color?: string | number | Color; offsetX?: number; offsetY?: number; } | null

Defined in: server/api.d.ts:4527

A drop shadow; blur (at most 8) is approximated. Default a 1 px shadow.


optional sizeMode?: "screen" | "world"

Defined in: server/api.d.ts:4492

“screen” (default): fontSize pixels at any distance. “world”: fontSize pixels at one metre on a 1080p view, shrinking with distance.


optional style?: number | "none" | "shadow" | "outline" | "box"

Defined in: server/api.d.ts:4517

A preset for outline, shadow and background; blocks in the same call refine it.


optional text?: string

Defined in: server/api.d.ts:4462

UTF-8 text, at most 1024 bytes; ‘\n’ breaks lines.


optional virtualWorld?: number

Defined in: server/api.d.ts:4572

The virtual world it lives in while it is not attached, and returns to when detached.