WoW:API GameTooltip SetOwner: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
 
m (Move page script moved page API GameTooltip SetOwner to API GameTooltip SetOwner without leaving a redirect)
 
(11 intermediate revisions by 10 users not shown)
Line 1: Line 1:
<center>'''GameTooltip:SetOwner''' ''-Documentation by [[user:Xenoveritas|Xenoveritas]]-''</center>
{{widgetmethod}}
 
<!-- List return values and arguments as well as function name, follow Blizzard usage convention for args -->
 
GameTooltip:SetOwner(owner, anchor);
 
<!-- Describe the purpose of the function, though exhausting detail can be saved for a later section -->
 
Moves the game tooltip to a location based on the "owner" frame.
Moves the game tooltip to a location based on the "owner" frame.
GameTooltip:SetOwner(owner, "anchor"&#91;, +x, +y&#93;);


----
----
;''Arguments''
;''Arguments''


<!-- List each argument, together with its type -->
:(owner, "Anchor"&#91;, +x, +y&#93;)
:;owner : Frame - Owner frame, which defines the element where the tooltip is centered on. A pointer to the frame is required, not the frame name itself (use _G['MyFrame'] to get the pointer from the frame name).
:;anchor : String - a string that describes the anchor point as it would be set via the SetPoint() function.  Anchoring methods as follows:
::ANCHOR_TOPRIGHT    -------    SetPoint("BOTTOMRIGHT",object,"TOPRIGHT")
::ANCHOR_RIGHT      -------  SetPoint("BOTTOMLEFT",object,"TOPRIGHT")
::ANCHOR_BOTTOMRIGHT  -------      SetPoint("TOPLEFT",object,"BOTTOMRIGHT")
::ANCHOR_TOPLEFT  -------      SetPoint("BOTTOMLEFT",object,"TOPLEFT")
::ANCHOR_LEFT    -------    SetPoint("BOTTOMRIGHT",object,"TOPLEFT")
::ANCHOR_BOTTOMLEFT      -------    SetPoint("TOPRIGHT",object,"BOTTOMLEFT")
::ANCHOR_CURSOR
::ANCHOR_PRESERVE
::ANCHOR_NONE


:(owner, "Anchor")
You can also move the tooltip by x or y, where positive x is to the right and positive y is up. Thus, negative x is to the left and negative y is down. Doesn't work if anchor is ANCHOR_CURSOR.
:;owner : Frame - Owner frame, which defines the element where the tooltip is centered on
:;anchor : String - a string that describes the anchor point, "ANCHOR_LEFT" anchors it to the left edge, "ANCHOR_RIGHT" anchors it to the right edge


----
----
;''Returns''
;''Returns''


<!-- List each return value, together with its type -->
: Nothing.
: Nothing?


----
----
;''Details''
;''Details''


<!-- Details not appropriate for the main description can go here -->
: This will set the owner for tooltip:IsOwned(frame). For instance, first call GameTooltip:SetOwner(UIParent). Then GameTooltip:IsOwned(UIParent) will return 1.
 
: This only appears to be a convience method for setting the location of the tooltip, it doesn't seem to actually grant any "ownership" of the tooltip over anything else.
 
----
{{Template:WoW API}}
<!-- Update the category to the appropriate subsection, and be sure to put the function name as the label for the category link. Multiple subcategories are okay if appropriate, please dont link functions to the API Functions category directly. -->
[[Category:API Functions|Empty Template]]

Latest revision as of 04:45, 15 August 2023

Widget API ← GameTooltip < SetOwner

Moves the game tooltip to a location based on the "owner" frame.

GameTooltip:SetOwner(owner, "anchor"[, +x, +y]);

Arguments
(owner, "Anchor"[, +x, +y])
owner
Frame - Owner frame, which defines the element where the tooltip is centered on. A pointer to the frame is required, not the frame name itself (use _G['MyFrame'] to get the pointer from the frame name).
anchor
String - a string that describes the anchor point as it would be set via the SetPoint() function. Anchoring methods as follows:
ANCHOR_TOPRIGHT ------- SetPoint("BOTTOMRIGHT",object,"TOPRIGHT")
ANCHOR_RIGHT ------- SetPoint("BOTTOMLEFT",object,"TOPRIGHT")
ANCHOR_BOTTOMRIGHT ------- SetPoint("TOPLEFT",object,"BOTTOMRIGHT")
ANCHOR_TOPLEFT ------- SetPoint("BOTTOMLEFT",object,"TOPLEFT")
ANCHOR_LEFT ------- SetPoint("BOTTOMRIGHT",object,"TOPLEFT")
ANCHOR_BOTTOMLEFT ------- SetPoint("TOPRIGHT",object,"BOTTOMLEFT")
ANCHOR_CURSOR
ANCHOR_PRESERVE
ANCHOR_NONE

You can also move the tooltip by x or y, where positive x is to the right and positive y is up. Thus, negative x is to the left and negative y is down. Doesn't work if anchor is ANCHOR_CURSOR.


Returns
Nothing.

Details
This will set the owner for tooltip:IsOwned(frame). For instance, first call GameTooltip:SetOwner(UIParent). Then GameTooltip:IsOwned(UIParent) will return 1.