no edit summary
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
{{widgetmethod}} __NOTOC__ | {{widgetmethod}} __NOTOC__ | ||
= | Returns information about the anchor points for a region. | ||
point, relativeTo, relativePoint, xOfs, yOfs = MyRegion:GetPoint(n) | |||
point | == Arguments == | ||
; n | |||
: integer - number of point about which you want to retrieve info. Should be in range <tt>1 .. MyRegion:GetNumPoints()</tt> | |||
== Returns == | == Returns == | ||
; point | |||
: [[UITYPE FramePoint|FramePoint]] -- attachment point of frame <tt>MyFrame</tt> | |||
relativeTo: The frame | ; relativeTo | ||
relativePoint: attachment point | : Region -- The frame <tt>MyFrame</tt> is attached to (NOTE: this returns the actual widget object, if you want to get that object's name, use <tt>relativeTo:GetName()</tt>) | ||
xOfs: | ; relativePoint | ||
yOfs: | : [[UITYPE FramePoint|FramePoint]] -- attachment point of the <tt>relativeTo</tt> frame | ||
; xOfs | |||
: number -- horizontal offset; not necessarily integer (positive <tt>xOfs</tt> means shift to the right) | |||
; yOfs | |||
: number -- vertical offset; not necessarily integer (positive <tt>yOfs</tt> means shift upwards) | |||
== Example == | == Example == | ||
point,relativeTo,relativePoint,xOfs,yOfs = MyAddon_Frame1:GetPoint() | point, relativeTo, relativePoint, xOfs, yOfs = MyAddon_Frame1:GetPoint() | ||
DEFAULT_CHAT_FRAME:AddMessage(point) | DEFAULT_CHAT_FRAME:AddMessage(point) | ||
DEFAULT_CHAT_FRAME:AddMessage(relativeTo:GetName()) | DEFAULT_CHAT_FRAME:AddMessage(relativeTo:GetName()) | ||
DEFAULT_CHAT_FRAME:AddMessage(relativePoint) | DEFAULT_CHAT_FRAME:AddMessage(relativePoint) | ||
DEFAULT_CHAT_FRAME:AddMessage(xOfs) | DEFAULT_CHAT_FRAME:AddMessage(xOfs) | ||
DEFAULT_CHAT_FRAME:AddMessage(yOfs) | DEFAULT_CHAT_FRAME:AddMessage(yOfs) | ||
Result: | |||
TOP | TOP | ||
MyAddon_Frame0 | MyAddon_Frame0 | ||
BOTTOM | BOTTOM | ||
0 | 0 | ||
-10 | -10 | ||