WoW:FrameXML elements: Difference between revisions

m (new page experiment)
 
Line 11: Line 11:
=== GameTooltipTextLeft<i>&lt;num&gt;</i> ===
=== GameTooltipTextLeft<i>&lt;num&gt;</i> ===


Each line of text from the game tooltip is represented by one of these objects, replace &lt;num&gt; with the appropriate line number. To obtain the text of a line call the [[API FontString GetText|GameTooltipTextLeft<i>&lt;num&gt;</i>:GetText()]] function.
Each line of text from the game tooltip is represented by one of these objects, replace &lt;num&gt; with the appropriate line number (from 1 to the number of lines returned from GameTooltip:NumLines()). To obtain the text of a line call the [[API FontString GetText|GameTooltipTextLeft<i>&lt;num&gt;</i>:GetText()]] function.


<small>Not sure if there is a way to dynamically form a function name in lua based on a variable (which would allow easily looping through all tooltip lines).</small>
==== Example: Looping through all tooltip lines ====
local i = 1
while (i <= GameTooltip:NumLines()) do
    local mytext = getglobal("GameTooltipTextLeft" .. i);
    local text = mytext:GetText();
end
 
==== Notes ====
 
The tooltip displayed when the mouse is hovering over players and/or NPCs on the minimap is such that all the units being displayed are actually only on the first tooltip line.  So, if the tooltip showed 4 players, the names are all in the first tootip line, delimited by "\n".
 
=== MinimapCluster ===
 
Frame which represents the minimap area of the user interface.
 
==== Example: Determining if the mouse is over the minimap ====
if (MouseIsOver(MinimapCluster)) then
    -- do something
end
Anonymous user