Skip to content

TextLabel

A line of 3D text your gamemode put in the world with textLabels.create, as textLabels.listAll, textLabels.getById and the scriptMarkerCreated events give it. It does not change; read it again for a newer one.

Renamed in 0.28 from Label and LabelSettings; see renamed names.

type TextLabel = Readonly<{
markerKind: "textLabel"; id: number; text: string; position: Vector3; colorRgba: number;
drawDistance: number; testLineOfSight: boolean;
interior: number; virtualWorld: number; visible: boolean; players: readonly number[] | null;
}>;
type TextLabelSettings = MarkerTargeting & {
text: string; position: Vector3; colorRgba?: number; drawDistance?: number; testLineOfSight?: boolean;
};
Field Type Description
markerKind "textLabel" Tells it apart from the other world markers.
id number Its ID.
text string The line it shows.
position Vector3 Where it stands.
colorRgba number Its color, 0xRRGGBBAA.
drawDistance number How near a player must be to see it, in metres; 0 is the whole map.
testLineOfSight boolean true: hidden behind buildings.
interior, virtualWorld, visible, players Who sees it; see MarkerTargeting. players holds player IDs, or null for everyone.

TextLabelSettings has the same fields, all but text and position optional; the defaults are on textLabels.create.