textLabels.getById
Returns one of your text labels by its ID, or undefined when there is none.
Renamed in 0.28 from labels.get; see renamed names.
Signature
Section titled “Signature”textLabels.getById(id: number): TextLabel | undefinedParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
id |
number |
The ID from textLabels.create. |
Returns
Section titled “Returns”The TextLabel, or undefined for an ID that is not one of your text labels.
Example
Section titled “Example”import { textLabels, server } from "nativemp";
const markerId = 0; // the ID textLabels.create returnedconst marker = textLabels.getById(markerId);if (marker) server.log(`It is in virtual world ${marker.virtualWorld}`);Related
Section titled “Related”textLabels.create: make onetextLabels.update: change ittextLabels.destroy: remove ittextLabels.listAll: all of them