Skip to content
M2O Scripting APIScripting reference
Runtime classServer APIGenerated

TextLabel

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

Server-created replicated world-space text label.

new TextLabel(id): TextLabel

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

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

number

Existing text-label network entity identifier.

TextLabel

Entity.constructor

destroy(): void

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

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

void


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

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

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

number | Color

A Core.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:2921

Changes how far away clients can render the label.

number

Maximum rendering distance, clamped from 1 to 1000 world units.

void


setFadeDistance(distance): void

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

Changes the fade range approaching the draw-distance limit.

number

Distance over which the label fades out; negative values become zero.

void


setFontSize(size): void

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

Changes the rendered font size.

number

Font size clamped from 6 to 128.

void


setStyle(style): void

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

Changes the label’s rendering style.

number

Framework text-label style enum value; unsupported values are ignored.

void


setText(text): void

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

Changes the label’s displayed text.

string

Replacement text replicated to clients.

void


setVirtualWorld(world): void

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

Moves this entity into another virtual world.

number

Virtual-world identifier used to partition replication and visibility.

void

Entity.setVirtualWorld


setVisibleTo(player): void

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

Restricts replication of this entity to one owning connection while preserving normal range and visibility checks.

Entity | null

Player-owned entity whose connection should exclusively receive this entity, or null to clear the restriction.

void

Entity.setVisibleTo


toString(): string

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

Formats this label for logging and debugging.

string

Text containing the label ID and current text.

Entity.toString


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

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

Creates and replicates a world-space text label, up to the server-wide limit of 512.

number

World-space X coordinate.

number

World-space Y coordinate.

number

World-space Z coordinate.

string

Initial displayed text.

number

Optional initial font size from 6 to 128.

number

Optional initial draw distance from 1 to 1000 world units.

number

Optional virtual-world identifier; defaults to the entity default.

TextLabel

Handle for the newly created label.

readonly color: number

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

Current packed ARGB color.


readonly drawDistance: number

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

Current maximum rendering distance in world units.


readonly fadeDistance: number

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

Current fade range in world units.


readonly fontSize: number

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

Current font size.


readonly id: number

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

Immutable network entity identifier.

Entity.id


position: Vector3

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

Authoritative world-space position; assignment forces replicated state.

Entity.position


rotation: Vector3 | Quaternion

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

Authoritative rotation; reads return a quaternion and assignments accept a quaternion or Euler angles in degrees.

Entity.rotation


readonly style: number

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

Current framework text-label style enum value.


readonly text: string

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

Current replicated label text.


readonly virtualWorld: number

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

Current virtual-world identifier.

Entity.virtualWorld