textLabels.update
Changes the settings you give and keeps the rest. Players who see the text label see the change at once. players: null
makes it everyone’s again.
Renamed in 0.28 from labels.update; see renamed names.
Signature
Section titled “Signature”textLabels.update(id: number, changes: Partial<TextLabelSettings>): Promise<ActionResult>Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
id |
number |
The ID from textLabels.create. |
changes |
Partial<TextLabelSettings> |
Any of its settings; see textLabels.create. |
Returns
Section titled “Returns”A promise of an ActionResult: applied, or rejected with the codes of
textLabels.create, or marker-not-found for an ID that is not one of your text labels. A rejected update changes nothing.
Example
Section titled “Example”import { textLabels } from "nativemp";
for (const marker of textLabels.listAll()) await textLabels.update(marker.id, { text: "Closed", colorRgba: 0xFF0000FF });Related
Section titled “Related”textLabels.create: make onetextLabels.destroy: remove ittextLabels.listAll: all of themscriptMarkerUpdated: it changed