61 lines
2.3 KiB
Lua
61 lines
2.3 KiB
Lua
---@meta
|
|
|
|
---@class GameTooltip : Frame
|
|
GameTooltip = {
|
|
--- Adds a line of text to the tooltip.
|
|
--- @param text string The text to add.
|
|
--- @param r number? Optional. The red component (0-1).
|
|
--- @param g number? Optional. The green component (0-1).
|
|
--- @param b number? Optional. The blue component (0-1).
|
|
--- @param wrap boolean? Optional. Whether to wrap the text.
|
|
--- @example
|
|
--- myGameTooltip:AddLine("New Line", 1.0, 0.0, 0.0)
|
|
AddLine = function(self, text, r, g, b, wrap) end,
|
|
|
|
--- Adds a line with left and right text to the tooltip.
|
|
--- @param textLeft string The left text.
|
|
--- @param textRight string The right text.
|
|
--- @param leftR number? Optional. Left text red component (0-1).
|
|
--- @param leftG number? Optional. Left text green component (0-1).
|
|
--- @param leftB number? Optional. Left text blue component (0-1).
|
|
--- @param rightR number? Optional. Right text red component (0-1).
|
|
--- @param rightG number? Optional. Right text green component (0-1).
|
|
--- @param rightB number? Optional. Right text blue component (0-1).
|
|
--- @example
|
|
--- myGameTooltip:AddDoubleLine("Left", "Right", 1.0, 0.0, 0.0, 0.0, 1.0, 0.0)
|
|
AddDoubleLine = function(self, textLeft, textRight, leftR, leftG, leftB, rightR, rightG, rightB) end,
|
|
|
|
--- Clears all lines from the tooltip.
|
|
--- @example
|
|
--- myGameTooltip:ClearLines()
|
|
ClearLines = function(self) end,
|
|
|
|
--- Gets the number of lines in the tooltip.
|
|
--- @return number numLines The number of lines.
|
|
--- @example
|
|
--- local numLines = myGameTooltip:NumLines()
|
|
NumLines = function(self) end,
|
|
|
|
--- Sets the text of the tooltip.
|
|
--- @param text string The text to set.
|
|
--- @param r number? Optional. The red component (0-1).
|
|
--- @param g number? Optional. The green component (0-1).
|
|
--- @param b number? Optional. The blue component (0-1).
|
|
--- @param wrap boolean? Optional. Whether to wrap the text.
|
|
--- @example
|
|
--- myGameTooltip:SetText("Tooltip Text", 1.0, 1.0, 1.0)
|
|
SetText = function(self, text, r, g, b, wrap) end,
|
|
|
|
--- Sets the tooltip to show item information.
|
|
--- @param itemLink string|number The item ID or link.
|
|
--- @example
|
|
--- myGameTooltip:SetHyperlink("item:12345:0:0:0:0:0:0:0")
|
|
SetHyperlink = function(self, itemLink) end,
|
|
|
|
--- Sets the tooltip to show unit information.
|
|
--- @param unit string The unit ID.
|
|
--- @example
|
|
--- myGameTooltip:SetUnit("player")
|
|
SetUnit = function(self, unit) end,
|
|
}
|