Sym3Label

Represents a symbol/text label that can be attached to equipment.

Constructor

constructor(equipmentName: string, symbol: number)

Construct a new label. This cannot be called before Sym3 is initialised.

  • equipmentName (string): The equipment to display the label on.
  • symbol (number): The symbol to display on the label. Can be either Sym3Icon.Error, Sym3Icon.Warning, Sym3Icon.OrangeDrop, Sym3Icon.RedDrop, or Sym3Icon.BlueDrop.

Member Functions

void Remove()

Release any memory associated with this label, and do not display it anymore. If you want to attach a label after this point, you will have to construct a new one.

Properties

Changing these properties will change the label on the fly. Both get and set properties exist for each.

  • LabelStyle (number): The style of label to use. Either Sym3LabelStyle.NoBackdrop, Sym3LabelStyle.BoxBackdrop, Sym3LabelStyle.PointLeftBackdrop, or Sym3Label.Annotation.
  • Position (Sym3Vec3): The offset of the label from the equipment origin.
  • FontColor (Sym3Color): The color of the font.
  • BackDropColor (Sym3Color): The color of the backdrop.
  • Billboard (boolean): If true, the label will always face the camera.
  • FontSize (int): The size of the font used for text.
  • AlwaysOnTop (boolean): If true, the label will be on top of the world.
  • Text (string): The text displayed on the label.
  • TextOffset (Sym3Vec2): The offset of the text relative to the leftmost portion of the label.
  • SymbolVisible (boolean): If true, the symbol will be displayed.
  • SymbolSize (int): The size of the symbol, in font size.
  • SymbolOffset (Sym3Vec2): The offset of the symbol relative to the leftmost portion of the label.
  • SymbolIndex (int): The icon to use – same as the symbol parameter to the constructor.
  • Visible (boolean): If false, none of the label will be displayed.

Example

Attach a label to a piece of equipment and set its text.

let label = new Sym3Label("MyEquipment", Sym3Icon.Warning);
label.Text = "Warning: Dangerous!";