Skip to content
ASArcaneMP Scripting APIScripting reference
Runtime classServer APIGenerated

TextLabel

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

Server-created replicated world-space text label.

  • ServerEntity

new TextLabel(id): TextLabel

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

Creates a wrapper for an existing text label; use TextLabel.create to spawn one.

number

Existing text-label network entity identifier.

TextLabel

attachTo(target, offset?, bone?): void

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

Follows another live entity instead of staying at the label’s own position. It streams from where the target is, moves into its virtual world and is destroyed with it.

number | ServerEntity

The entity to follow, or its network id.

Vector3 | { x: number; y: number; z: number; }

Where to draw relative to it, in world axes; the game decides the reference point (a player’s head, say) unless a bone is given.

string | null

A bone or socket of the target to follow every frame, at most 64 bytes; the offset counts from it. Omitted or null follows the entity.

void


destroy(): void

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

Destroys this replicated label; stale wrappers no longer resolve afterward.

void


detach(): void

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

Stops following an entity; the label returns to its own position.

void


getAudience(): object

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

Who the label is for, with players as network ids. For reading: a connected player with no avatar right now has no id and is left out, though the label stays as set for them, so passing this to update() would drop them.

object

hideForTarget: boolean

hideFrom: number[]

showTo: number[] | null


getOptions(): TextLabelOptions

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

The label’s current look and placement, in the shape update() takes. The audience is left out: see getAudience().

TextLabelOptions


setColor(colorOrR, g?, b?, a?): void

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

Changes the label’s packed ARGB color from a Color or byte components.

number | Color

A Color, or the red byte (0-255) when passing components.

number

Green byte (0-255) when passing components.

number

Blue byte (0-255) when passing components.

number

Alpha byte (0-255) when passing components; defaults to 255.

void


setDrawDistance(distance): void

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

Changes how far away clients can render the label.

number

Maximum rendering distance in world units, clamped from 1 to 1000 metres’ worth.

void


setFadeDistance(distance): void

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

Changes where the label starts fading out.

number

Distance in world units where fading starts; 0 starts it at 75% of the draw distance.

void


setFont(family): void

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

Changes the label’s font. A viewer whose client never registered the family sees the game’s font.

string

A family viewers’ clients registered with Fonts.register, at most 64 bytes; empty is the game’s font.

void


setFontSize(size): void

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

Changes the rendered font size.

number

Font size in pixels, clamped from 1 to 512.

void


setMinDrawDistance(distance): void

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

Changes how close the label stops drawing, so another can take over up close. It is still sent that close, so the swap has no gap; one at or past the draw distance never draws.

number

World units, clamped from 0 to 1000 metres’ worth; 0 draws from the camera out.

void


setMinFadeDistance(distance): void

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

Changes how far the label fades in from its min draw distance.

number

World units where the label is fully faded in; at or below the min draw distance it appears at once.

void


setStyle(style): void

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

Resets the outline, shadow and background to a preset.

number

0 none, 1 shadow, 2 outline, 3 box; unsupported values are ignored.

void


setText(text): void

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

Changes the label’s displayed text.

string

Replacement text replicated to clients; at most 1024 bytes.

void


setVirtualWorld(world): void

Defined in: shared.d.ts:80

Moves this entity into another virtual world.

number

void


setVisibleFor(player, visible): void

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

Shows or hides the label for one player. A hidden player’s client is never sent it; hideForTarget still applies.

number | Player

A connected player, or their network id.

boolean

false adds them to hideFrom and takes them off showTo; true undoes both, adding them to showTo while it is set.

void


setVisibleTo(player): void

Defined in: shared.d.ts:82

Restricts replication to one player’s connection, within the usual range and visibility checks; null lifts it.

Entity | null

void


toString(): string

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

Formats this label for logging and debugging.

string

Text containing the label ID and current text.


update(options): void

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

Changes any part of the label at once. A bad key throws and changes nothing.

TextLabelOptions

Only the keys given change; outline, shadow, background, showTo and hideFrom are replaced whole.

void


static create(x, y, z, text, fontSizeOrOptions?, drawDistance?, virtualWorld?): TextLabel

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

Creates and replicates a world-space text label, up to the server-wide limit of 512. A bad option throws and creates nothing.

number

World-space X coordinate.

number

World-space Y coordinate.

number

World-space Z coordinate.

string

Initial displayed text.

number | TextLabelOptions

Look and placement, or (the older form) the font size from 1 to 512.

number

Older form only: the draw distance in world units.

number

Older form only: the virtual-world identifier.

TextLabel

Handle for the newly created label.

readonly attachBone: string

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

The bone or socket of its target it follows; empty follows the entity.


readonly color: number

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

Current packed ARGB color.


readonly drawDistance: number

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

Current maximum rendering distance in world units.


readonly fadeDistance: number

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

Distance in world units where fading starts.


readonly font: string

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

The font family it asks for; empty is the game’s font.


readonly fontSize: number

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

Current font size.


readonly id: number

Defined in: shared.d.ts:65

Network id, stable for the entity’s lifetime.


readonly minDrawDistance: number

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

Distance in world units up to which the label does not draw.


readonly minFadeDistance: number

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

Distance in world units where the label is fully faded in.


position: Vector3

Defined in: shared.d.ts:67

World position. Read, call set(...), then assign back.


rotation: Vector3 | Quaternion

Defined in: shared.d.ts:69

Reads as a quaternion; assignments also accept Euler angles in degrees.


readonly state: StateBag

Defined in: shared.d.ts:71

This entity’s key/value state: the server writes it, and every client that can see the entity receives it. See StateBag.


readonly style: number

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

The preset nearest the current look: 0 none, 1 shadow, 2 outline, 3 box.


readonly text: string

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

Current replicated label text.


readonly virtualWorld: number

Defined in: shared.d.ts:73

The virtual world this entity replicates in. Read-only: change it with setVirtualWorld on the server.