Links |
---|
Add a line to a GameTooltip consisting of a left-aligned part and a right-aligned part.
GameTooltip:AddDoubleLine(leftText, rightText [, leftR, leftG, leftB [, rightR, rightG, rightB]])
Arguments
- leftText
- string - Text to be displayed on the left.
- rightText
- string - Text to be displayed on the right.
- leftR
- number? - Red color component for the left text, between 0 and 1.
- leftG
- number? - Green color component for the left text, between 0 and 1.
- leftB
- number? - Blue color component for the left text, between 0 and 1.
- rightR
- number? - Red color component for the right text, between 0 and 1.
- rightG
- number? - Green color component for the right text, between 0 and 1.
- rightB
- number? - Blue color component for the right text, between 0 and 1.
Example
The following snippet would display a tooltip to the right of the cursor, with the word "Left" in red on the left side and the word "Right" in blue on the right side:
GameTooltip:ClearLines();
GameTooltip:SetOwner(UIParent, "ANCHOR_CURSOR_RIGHT");
GameTooltip:AddDoubleLine("Left", "Right", 1, 0, 0, 0 ,0, 1);
GameTooltip:Show();
Details
- The default color for the text is NORMAL_FONT_COLOR (1.0, 0.82, 0.0).
- To use the default color for the left text and a custom color for the right text, use nil as the value for the left text's color components.