SixL client API / world-entities / TextLabelMp

Interface: TextLabelMp

A text label: a line of text drawn at a position in the world, one that the server created for this client or one a script made with mp.labels.new.

Remarks

Drawn by SixL's overlay, facing the screen, within its draw distance. The properties of a label the server made are the server's: assigning them changes nothing. The properties of a label a script made can be assigned.

Example

mp.labels.forEach((label) => mp.console.logInfo(label.text));

Properties

color

color: Array4d

The text colour, as [r, g, b, a], each 0..255.

Example

const rgba = label.color;

drawDistance

drawDistance: number

The distance, in metres, within which the label is drawn.

Example

const range = label.drawDistance;

los

los: boolean

Whether the label is hidden behind walls (line of sight).

Remarks

Partial: the overlay does not know the walls, so it draws the label whatever stands in front of it.

Example

if (label.los) { }

position

position: Vector3

The label's position, in metres.

Example

const where = label.position;

text

text: string

The label's text.

Example

const words = label.text;

Methods

destroy()

destroy(): void

Removes a label a script made. Does nothing for a label the server made.

Returns

void

Example

label.destroy();