GameTooltips are used to display explanatory information relevant to a particular element of the game world. They offer almost innumerable methods for setting the specific object, creature or ability the tooltip should describe, and a smaller number of methods for querying what it is that the tooltip is currently describing.
GameTooltips are sufficiently complicated that an entire chapter is dedicated to describing them. In addition to methods for setting their contents, they also support options controlling their positioning and visibility on screen, as well as methods to facilitate adding more text to them (for instance, an addon that displays, in the tooltip for a soul shard created by a warlock, the name of the player or monster from which the shard was collected).
While most of the heavy lifting is done by the frame called simply GameTooltip, there is also one called ItemRefTooltip that does the work of displaying information about items linked in chat when they are clicked.
Defined Methods
- GameTooltip:AddDoubleLine("textLeft", "textRight" [, rL [, gL [, bL [, rR [, gR [, bR]]]]]]) - Adds a line to the tooltip with both left-side and right-side portions
- GameTooltip:AddFontStrings(left, right) - Adds `FontString` objects to the tooltip, allowing it to display an additional line of text
- GameTooltip:AddLine("text" [, r [, g [, b [, wrap]]]]) - Adds a line of text to the tooltip
- GameTooltip:AddTexture("texture") - Adds a texture to the last tooltip line
- GameTooltip:AppendText("text") - Adds text to the first line of the tooltip
- GameTooltip:ClearLines() - Clears the tooltip's contents
- GameTooltip:FadeOut() - Causes the tooltip to begin fading out
- anchor = GameTooltip:GetAnchorType() - Returns the method for anchoring the tooltip relative to its owner
- name, link = GameTooltip:GetItem() - Returns the name and hyperlink for the item displayed in the tooltip
- width = GameTooltip:GetMinimumWidth() - Returns the minimum width of the tooltip
- owner = GameTooltip:GetOwner() - Returns the frame to which the tooltip refers and is anchored
- padding = GameTooltip:GetPadding() - Returns the amount of space between tooltip's text and its right-side edge
- spellName, spellRank, spellID = GameTooltip:GetSpell() - Returns information about the spell displayed in the tooltip
- name, unit = GameTooltip:GetUnit() - Returns information about the unit displayed in the tooltip
- enabled = GameTooltip:IsEquippedItem() - Returns whether the tooltip is displaying an item currently equipped by the player
- hasOwner = GameTooltip:IsOwned() - Returns whether the tooltip has an owner frame
- isUnit = GameTooltip:IsUnit("unit") - Returns whether the tooltip is displaying information for a given unit
- numLines = GameTooltip:NumLines() - Returns the number of lines of text currently shown in the tooltip
- GameTooltip:SetAction(slot) - Fills the tooltip with information about the contents of an action slot
- GameTooltip:SetAnchorType("anchor" [, xOffset [, yOffset]]) - Sets the method for anchoring the tooltip relative to its owner
- GameTooltip:SetAuctionItem("list", index) - Fills the tooltip with information about an item in the auction house
- GameTooltip:SetAuctionSellItem() - Fills the tooltip with information about the item currently being set up for auction
- GameTooltip:SetBackpackToken(index) - Fills the tooltip with information about a currency marked for watching on the Backpack UI
- hasCooldown, repairCost = GameTooltip:SetBagItem(container, slot) - Fills the tooltip with information about an item in the player's bags
- GameTooltip:SetBuybackItem(index) - Fills the tooltip with information about item recently sold to a vendor and available to be repurchased
- GameTooltip:SetCurrencyToken(index) - Fills the tooltip with information about a special currency type
- GameTooltip:SetEquipmentSet("name") - Fills the tooltip with information about an equipment set
- GameTooltip:SetExistingSocketGem(index, toDestroy) - Fills the tooltip with information about a permanently socketed gem
- GameTooltip:SetFrameStack(includeHidden) - Fills the tooltip with a list of frames under the mouse cursor
- GameTooltip:SetGlyph(socket, talentGroup) - Fills the tooltip with information about one of the player's glyphs
- GameTooltip:SetGuildBankItem(tab, slot) - Fills the tooltip with information about an item in the guild bank
- GameTooltip:SetHyperlink("hyperlink") - Fills the tooltip with information about an item, quest, spell, or other entity represented by a hyperlink
- success = GameTooltip:SetHyperlinkCompareItem("hyperlink" [, index]) - Fills the tooltip with information about the item currently equipped in the slot used the supplied item
- GameTooltip:SetInboxItem(mailID, attachmentIndex) - Fills the tooltip with information about an item attached to a message in the player's inbox
- hasItem, hasCooldown, repairCost = GameTooltip:SetInventoryItem("unit", slot [, nameOnly]) - Fills the tooltip with information about an equipped item
- GameTooltip:SetLFGCompletionReward() - This function is not yet documented
- GameTooltip:SetLFGDungeonReward() - This function is not yet documented
- GameTooltip:SetLootItem(slot) - Fills the tooltip with information about an item available as loot
- GameTooltip:SetLootRollItem(id) - Fills the tooltip with information about an item currently up for loot rolling
- GameTooltip:SetMerchantCostItem(index, currency) - Fills the tooltip with information about an alternate currency required to purchase an item from a vendor
- GameTooltip:SetMerchantItem(merchantIndex) - Fills the tooltip with information about an item available for purchase from a vendor
- GameTooltip:SetMinimumWidth(width) - Sets the minimum width of the tooltip
- GameTooltip:SetOwner(frame [, "anchorType" [, xOffset [, yOffset]]]) - Sets the frame to which the tooltip refers and is anchored
- GameTooltip:SetPadding(padding) - Sets the amount of space between tooltip's text and its right-side edge
- GameTooltip:SetPetAction(index) - Fills the tooltip with information about a pet action
- GameTooltip:SetPossession(index) - Fills the tooltip with information about one of the special actions available while the player possesses another unit
- GameTooltip:SetQuestItem("itemType", index) - Fills the tooltip with information about an item in a questgiver dialog
- GameTooltip:SetQuestLogItem("itemType", index) - Fills the tooltip with information about an item related to the selected quest in the quest log
- GameTooltip:SetQuestLogRewardSpell() - Fills the tooltip with information about the reward spell for the selected quest in the quest log
- GameTooltip:SetQuestLogSpecialItem(questIndex) - Fills the tooltip with information about a usable item associated with a current quest
- GameTooltip:SetQuestRewardSpell() - Fills the tooltip with information about the spell reward in a questgiver dialog
- GameTooltip:SetSendMailItem(slot) - Fills the tooltip with information about an item attached to the outgoing mail message
- GameTooltip:SetShapeshift(index) - Fills the tooltip with information about an ability on the stance/shapeshift bar
- GameTooltip:SetSocketGem(index) - Fills the tooltip with information about a gem added to a socket
- GameTooltip:SetSocketedItem() - Fills the tooltip with information about the item currently being socketed
- GameTooltip:SetSpell(id, "bookType") - Fills the tooltip with information about a spell from the player (or pet's) spellbook
- GameTooltip:SetSpellByID(id) - Fills the tooltip with information about a spell specified by ID
- GameTooltip:SetTalent(tabIndex, talentIndex, inspect, pet, talentGroup) - Fills the tooltip with information about a talent
- GameTooltip:SetText("text" [, r [, g [, b [, a]]]]) - Sets the tooltip's text
- GameTooltip:SetTotem(slot) - Fills the tooltip with information about one of the player's active totems.
- GameTooltip:SetTracking() - Fills the tooltip with information about the currently selected tracking type
- GameTooltip:SetTradePlayerItem(index) - Fills the tooltip with information about an item offered for trade by the player
- GameTooltip:SetTradeSkillItem(skillIndex [, reagentIndex]) - Fills the tooltip with information about an item created by a trade skill recipe or a reagent in the recipe
- GameTooltip:SetTradeTargetItem(index) - Fills the tooltip with information about an item offered for trade by the target
- GameTooltip:SetTrainerService(index) - Fills the tooltip with information about a trainer service
- GameTooltip:SetUnit("unit") - Fills the tooltip with information about a unit
- GameTooltip:SetUnitAura("unit", index [, "filter"]) - Fills the tooltip with information about a buff or debuff on a unit
- GameTooltip:SetUnitBuff("unit", index [, "filter"]) - Fills the tooltip with information about a buff on a unit
- GameTooltip:SetUnitDebuff("unit", index [, "filter"]) - Fills the tooltip with information about a debuff on a unit
Inherited Methods
- GameTooltip:AllowAttributeChanges() - Temporarily allows insecure code to modify the frame's attributes during combat
- enabled = GameTooltip:CanChangeAttribute() - Returns whether secure frame attributes can currently be changed
- canChange = GameTooltip:CanChangeProtectedState() - Returns whether protected properties of the region can be changed by non-secure scripts
- GameTooltip:ClearAllPoints() - Removes all anchor points from the region
- animationGroup = GameTooltip:CreateAnimationGroup(["name" [, "inheritsFrom"]]) - Creates a new AnimationGroup as a child of the region
- fontstring = GameTooltip:CreateFontString(["name" [, "layer" [, "inherits"]]]) - Creates a new [[docs/widgets/FontString|`FontString`]] as a child of the frame
- texture = GameTooltip:CreateTexture(["name" [, "layer" [, "inherits"]]]) - Creates a new [[docs/widgets/Texture|`Texture`]] as a child of the frame
- region = GameTooltip:CreateTitleRegion() - Creates a title region for dragging the frame
- GameTooltip:DisableDrawLayer("layer") - Prevents display of all child objects of the frame on a specified graphics layer
- GameTooltip:EnableDrawLayer("layer") - Allows display of all child objects of the frame on a specified graphics layer
- GameTooltip:EnableJoystick(enable) - Enables or disables joystick interactivity
- GameTooltip:EnableKeyboard(enable) - Enables or disables keyboard interactivity for the frame
- GameTooltip:EnableMouse(enable) - Enables or disables mouse interactivity for the frame
- GameTooltip:EnableMouseWheel(enable) - Enables or disables mouse wheel interactivity for the frame
- alpha = GameTooltip:GetAlpha() - Returns the opacity of the region relative to its parent
- ... = GameTooltip:GetAnimationGroups() - Returns a list of animation groups belonging to the region
- value = GameTooltip:GetAttribute("name") - Returns the value of a secure frame attribute
- backdrop = GameTooltip:GetBackdrop() - Returns information about the frame's backdrop graphic
- red, green, blue, alpha = GameTooltip:GetBackdropBorderColor() - Returns the shading color for the frame's border graphic
- red, green, blue, alpha = GameTooltip:GetBackdropColor() - Returns the shading color for the frame's background graphic
- bottom = GameTooltip:GetBottom() - Returns the distance from the bottom of the screen to the bottom of the region
- left, bottom, width, height = GameTooltip:GetBoundsRect() - Returns the position and dimension of the smallest area enclosing the frame and its children
- x, y = GameTooltip:GetCenter() - Returns the screen coordinates of the region's center
- ... = GameTooltip:GetChildren() - Returns a list of child frames of the frame
- left, right, top, bottom = GameTooltip:GetClampRectInsets() - Returns offsets from the frame's edges used when limiting user movement or resizing of the frame
- depth = GameTooltip:GetDepth() - Returns the 3D depth of the frame (for stereoscopic 3D setups)
- alpha = GameTooltip:GetEffectiveAlpha() - Returns the overall opacity of the frame
- depth = GameTooltip:GetEffectiveDepth() - Returns the overall 3D depth of the frame (for stereoscopic 3D configurations)
- scale = GameTooltip:GetEffectiveScale() - Returns the overall scale factor of the frame
- level = GameTooltip:GetFrameLevel() - Sets the level at which the frame is layered relative to others in its strata
- strata = GameTooltip:GetFrameStrata() - Returns the general layering strata of the frame
- height = GameTooltip:GetHeight() - Returns the height of the region
- left, right, top, bottom = GameTooltip:GetHitRectInsets() - Returns the insets from the frame's edges which determine its mouse-interactable area
- id = GameTooltip:GetID() - Returns the frame's numeric identifier
- left = GameTooltip:GetLeft() - Returns the distance from the left edge of the screen to the left edge of the region
- maxWidth, maxHeight = GameTooltip:GetMaxResize() - Returns the maximum size of the frame for user resizing
- minWidth, minHeight = GameTooltip:GetMinResize() - Returns the minimum size of the frame for user resizing
- name = GameTooltip:GetName() - Returns the widget object's name
- numChildren = GameTooltip:GetNumChildren() - Returns the number of child frames belonging to the frame
- numPoints = GameTooltip:GetNumPoints() - Returns the number of anchor points defined for the region
- numRegions = GameTooltip:GetNumRegions() - Returns the number of non-Frame child regions belonging to the frame
- type = GameTooltip:GetObjectType() - Returns the object's widget type
- parent = GameTooltip:GetParent() - Returns the object's parent object
- point, relativeTo, relativePoint, xOffset, yOffset = GameTooltip:GetPoint(index) - Returns information about one of the region's anchor points
- left, bottom, width, height = GameTooltip:GetRect() - Returns the position and dimensions of the region
- ... = GameTooltip:GetRegions() - Returns a list of non-Frame child regions belonging to the frame
- right = GameTooltip:GetRight() - Returns the distance from the left edge of the screen to the right edge of the region
- scale = GameTooltip:GetScale() - Returns the frame's scale factor
- handler = GameTooltip:GetScript("scriptType") - Returns the widget's handler function for a script
- width, height = GameTooltip:GetSize() - Returns the width and height of the region
- region = GameTooltip:GetTitleRegion() - Returns the frame's TitleRegion object
- top = GameTooltip:GetTop() - Returns the distance from the bottom of the screen to the top of the region
- width = GameTooltip:GetWidth() - Returns the width of the region
- hasScript = GameTooltip:HasScript("scriptType") - Returns whether the widget supports a script handler
- GameTooltip:Hide() - Hides the region
- GameTooltip:HookScript("scriptType", handler) - Securely hooks a script handler
- GameTooltip:IgnoreDepth(enable) - Sets whether the frame's depth property is ignored (for stereoscopic 3D setups)
- enabled = GameTooltip:IsClampedToScreen() - Returns whether the frame's boundaries are limited to those of the screen
- isDragging = GameTooltip:IsDragging() - Returns whether the region is currently being dragged
- registered = GameTooltip:IsEventRegistered("event") - Returns whether the frame is registered for a given [[docs/events|event]]
- enabled = GameTooltip:IsIgnoringDepth() - Returns whether the frame's depth property is ignored (for stereoscopic 3D setups)
- enabled = GameTooltip:IsJoystickEnabled() - Returns whether joystick interactivity is enabled for the frame
- enabled = GameTooltip:IsKeyboardEnabled() - Returns whether keyboard interactivity is enabled for the frame
- enabled = GameTooltip:IsMouseEnabled() - Returns whether mouse interactivity is enabled for the frame
- isOver = GameTooltip:IsMouseOver() - Returns whether the mouse cursor is over the given region
- enabled = GameTooltip:IsMouseWheelEnabled() - Returns whether mouse wheel interactivity is enabled for the frame
- movable = GameTooltip:IsMovable() - Returns whether the frame can be moved by the user
- isType = GameTooltip:IsObjectType("type") - Returns whether the object belongs to a given widget type
- isProtected, explicit = GameTooltip:IsProtected() - Returns whether the region is protected
- enabled = GameTooltip:IsResizable() - Returns whether the frame can be resized by the user
- shown = GameTooltip:IsShown() - Returns whether the region is shown
- enabled = GameTooltip:IsToplevel() - Returns whether the frame is automatically raised to the front when clicked
- enabled = GameTooltip:IsUserPlaced() - Returns whether the frame is flagged for automatic saving and restoration of position and dimensions
- visible = GameTooltip:IsVisible() - Returns whether the region is visible
- GameTooltip:Lower() - Reduces the frame's frame level below all other frames in its strata
- GameTooltip:Raise() - Increases the frame's frame level above all other frames in its strata
- GameTooltip:RegisterAllEvents() - Registers the frame for all events
- GameTooltip:RegisterEvent("event") - Registers the frame for an [[docs/events|event]]
- GameTooltip:RegisterForDrag(...) - Registers the frame for dragging
- GameTooltip:SetAllPoints([region]) or GameTooltip:SetAllPoints(["name"]) - Sets all anchor points of the region to match those of another region
- GameTooltip:SetAlpha(alpha) - Sets the opacity of the region relative to its parent
- GameTooltip:SetAttribute("name", value) - Sets a secure frame attribute
- GameTooltip:SetBackdrop(backdrop) - Sets a backdrop graphic for the frame
- GameTooltip:SetBackdropBorderColor(red, green, blue [, alpha]) - Sets a shading color for the frame's border graphic
- GameTooltip:SetBackdropColor(red, green, blue [, alpha]) - Sets a shading color for the frame's background graphic
- GameTooltip:SetClampRectInsets(left, right, top, bottom) - Sets offsets from the frame's edges used when limiting user movement or resizing of the frame
- GameTooltip:SetClampedToScreen(enable) - Sets whether the frame's boundaries should be limited to those of the screen
- GameTooltip:SetDepth(depth) - Sets the 3D depth of the frame (for stereoscopic 3D configurations)
- GameTooltip:SetFrameLevel(level) - Sets the level at which the frame is layered relative to others in its strata
- GameTooltip:SetFrameStrata("strata") - Sets the general layering strata of the frame
- GameTooltip:SetHeight(height) - Sets the region's height
- GameTooltip:SetHitRectInsets(left, right, top, bottom) - Sets the insets from the frame's edges which determine its mouse-interactable area
- GameTooltip:SetID(id) - Sets a numeric identifier for the frame
- GameTooltip:SetMaxResize(maxWidth, maxHeight) - Sets the maximum size of the frame for user resizing
- GameTooltip:SetMinResize(minWidth, minHeight) - Sets the minimum size of the frame for user resizing
- GameTooltip:SetMovable(enable) - Sets whether the frame can be moved by the user
- GameTooltip:SetParent(frame) or GameTooltip:SetParent("name") - Makes another frame the parent of this region
- GameTooltip:SetPoint("point" [, relativeTo [, "relativePoint" [, xOffset [, yOffset]]]]) - Sets an anchor point for the region
- GameTooltip:SetResizable(enable) - Sets whether the frame can be resized by the user
- GameTooltip:SetScale(scale) - Sets the frame's scale factor
- GameTooltip:SetScript("scriptType", handler) - Sets the widget's handler function for a script
- GameTooltip:SetSize(width, height) - Sets the size of the region to the specified values
- GameTooltip:SetToplevel(enable) - Sets whether the frame should automatically come to the front when clicked
- GameTooltip:SetUserPlaced(enable) - Flags the frame for automatic saving and restoration of position and dimensions
- GameTooltip:SetWidth(width) - Sets the region's width
- GameTooltip:Show() - Shows the region
- GameTooltip:StartMoving() - Begins repositioning the frame via mouse movement
- GameTooltip:StartSizing() - Begins resizing the frame via mouse movement
- GameTooltip:StopAnimating() - Stops any active animations involving the region or its children
- GameTooltip:StopMovingOrSizing() - Ends movement or resizing of the frame initiated with [[docs/widgets/Frame/StartMoving|`:StartMoving()`]] or [[docs/widgets/Frame/StartSizing|`:StartSizing()`]]
- GameTooltip:UnregisterAllEvents() - Unregisters the frame from any [[docs/events|events]] for which it is registered
- GameTooltip:UnregisterEvent("event") - Unregisters the frame for an event
Script Handlers
- OnAttributeChanged(self, "name", value) - Run when a frame attribute is changed
- OnChar(self, "text") - Run for each text character typed in the frame
- OnDisable(self) - Run when the frame is disabled
- OnDragStart(self, "button") - Run when the mouse is dragged starting in the frame
- OnDragStop(self) - Run when the mouse button is released after a drag started in the frame
- OnEnable(self) - Run when the frame is enabled
- OnEnter(self, motion) - Run when the mouse cursor enters the frame's interactive area
- OnEvent(self, "event", ...) - Run whenever an [[docs/events|event]] fires for which the frame is registered
- OnHide(self) - Run when the frame's visbility changes to hidden
- OnKeyDown(self, "key") - Run when a keyboard key is pressed if the frame is keyboard enabled
- OnKeyUp(self, "key") - Run when a keyboard key is released if the frame is keyboard enabled
- OnLeave(self, motion) - Run when the mouse cursor leaves the frame's interactive area
- OnLoad(self) - Run when the frame is created
- OnMouseDown(self, "button") - Run when a mouse button is pressed while the cursor is over the frame
- OnMouseUp(self, "button") - Run when the mouse button is released following a mouse down action in the frame
- OnMouseWheel(self, delta) - Run when the frame receives a mouse wheel scrolling action
- OnReceiveDrag(self) - Run when the mouse button is released after dragging into the frame
- OnShow(self) - Run when the frame becomes visible
- OnSizeChanged(self, width, height) - Run when a frame's size changes
- OnTooltipAddMoney(self, amount, maxAmount) - Run when an amount of money should be added to the tooltip
- OnTooltipCleared(self) - Run when the tooltip is hidden or its content is cleared
- OnTooltipSetAchievement(self) - Run when the tooltip is filled with information about an achievement
- OnTooltipSetDefaultAnchor(self) - Run when the tooltip is repositioned to its default anchor location
- OnTooltipSetEquipmentSet(self) - Run when the tooltip is filled with information about an equipment set
- OnTooltipSetFrameStack(self) - Run when the tooltip is filled with a list of frames under the mouse cursor
- OnTooltipSetItem(self) - Run when the tooltip is filled with information about an item
- OnTooltipSetQuest(self) - Run when the tooltip is filled with information about a quest
- OnTooltipSetSpell(self) - Run when the tooltip is filled with information about a spell
- OnTooltipSetUnit(self) - Run when the tooltip is filled with information about a unit
- OnUpdate(self, elapsed) - Run each time the screen is drawn by the game engine