SharedTooltipTemplate

From Warcraft Wiki
(Redirected from GameTooltipTemplate)
Jump to navigation Jump to search

Configures a functional GameTooltip.

<GameTooltip name="MyTooltip1" inherits="SharedTooltipTemplate" />
<GameTooltip name="MyTooltip2" inherits="GameTooltipTemplate" />

FrameXML defines these templates in:

  • SharedXML/SharedTooltipTemplate.xml {SharedTooltipTemplate at Townlong-YakSharedXML/SharedTooltipTemplates.xml at GitHub}
  • FrameXML/GameTooltip.xml {GameTooltipTemplate at Townlong-YakFrameXML/GameTooltip.xml at GitHub}

Key values

When inherited in XML with <GameTooltip>, further customizations are possible with <KeyValue> tags:

textLeft1Font
string - Name of a Font object to apply to the first line only (default: GameTooltipHeaderText).
textLeft2Font
string - Applies to the second and all subsequent lines (default: GameTooltipText).
textRight1Font
string - Applies with GameTooltip:AddDoubleLine() to the right side first line only (default: GameTooltipHeaderText).
textRight2Font
string - Applies to the second and all subsequent lines (default: GameTooltipText).
layoutType
string - Configures the NineSlicePanelTemplate child frame (default: TooltipDefaultLayout).

Details

  • SharedTooltipTemplate configures standard widgets for the tooltip's normal function, such as $parentTextLeft1, $parentTextRight1 and $parentTexture1
  • GameTooltipTemplate also adds a StatusBar that may appear with GameTooltip:SetUnit().
  • Fonts can also be changed in Lua with FontInstance:SetFontObject().