Wowpedia
Advertisement
Wowpedia
240,442
pages

Appends a line of text to the tooltip widget.

GameTooltip:AddLine(tooltipText [, r, g, b, wrapText])

Arguments

tooltipText 
string - Text to appear in new line.
number - Red color component (between 0 and 1).
number - Green color component (between 0 and 1).
number - Blue color component (between 0 and 1).
wrapText 
boolean - True allows the new line to wrap, false widens the tooltip as necessary to fit the line.

Details

  • The tooltip resizes in its OnShow handler,[1] so calling this function on an already-visible tooltip will cause the new line to appear outside of the tooltip's backdrop.
  • If the r, g, b values are not specified, the line appears in the game's normal font color (gold).
  • By default, the first line is a larger font (GameTooltipHeaderText) than subsequent lines (GameTooltipText).

Example

GameTooltip:SetOwner(TargetFrame, "ANCHOR_RIGHT")
GameTooltip:AddLine("First line")
GameTooltip:AddLine("Subsequent line", 1, 1, 1)
GameTooltip:Show()

References

 
  1. ^ GameTooltip_CalculatePadding() in FrameXML/GameTooltip.lua, archived at Townlong-Yak
Advertisement