SetTooltipBackgroundColor

Set the 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 background is the inner rectangle on the rightmost portion of the tooltip. It defaults to grey.

Function

void SetTooltipBackgroundColor(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 white background to what the user clicks/taps on. Nothing is rendered until your script returns, so no tooltip with a grey background will ever be seen by the user.

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