SetTooltipPrefixBackgroundColor

Set the prefix background color for a tooltip that has been attached. If called on a piece of equipment that has not had AttachTooltip called for it, this function will do nothing.

The prefix is the leftmost portion of the tooltip that looks a little like a speech bubble. If an index number is given to AttachTooltip, it is where that number will be displayed. The background of this prefix is the main inner portion of the ‘speech bubble’. It defaults to white.

Function

void SetTooltipPrefixBackgroundColor(equipment: string, r: int, g: int, b: int, a: int)

Parameters

  • equipment (string): the name of a piece of equipment with an attached tooltip to modify.
  • r (int): the red component of the color. Ranges from 0 to 255 (inclusive).
  • g (int): the green component of the color. Ranges from 0 to 255 (inclusive).
  • b (int): the blue component of the color. Ranges from 0 to 255 (inclusive).
  • a (int): the alpha component of the color. Ranges from 0 (totally transparent) to 255 (completely opaque, inclusive).

Example

Attaches a tooltip with a red prefix background to what the user clicks/taps on. Nothing is rendered until your script returns, so no tooltip with a white prefix background will ever be seen by the user.

function onSelectionChangedCallback(name)
{
    SYM3.AttachTooltip(name, `This is ${name}!`);
    SYM3.SetTooltipPrefixBackgroundColor(name, 255, 0, 0, 255);
}
SYM3.SetOnEquipmentSelectionChanged(onSelectionChangedCallback);