WoW:API Region GetPoint: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
{{widgetmethod}} __NOTOC__ Returns information about the anchor points for a region.
{{widgetmethod}} __NOTOC__  


== Usage ==
Returns information about the anchor points for a region.
point, relativeTo, relativePoint, xOfs, yOfs = MyRegion:GetPoint(n)


point,relativeTo,relativePoint,xOfs,yOfs = Region:GetPoint()
== 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
point: attachment point for this frame<br>
: [[UITYPE FramePoint|FramePoint]] -- attachment point of frame <tt>MyFrame</tt>
relativeTo: The frame this frame is attached to (NOTE: this returns the actual widget object, so you need to use "relativeTo:GetName()" to retrieve the object name itself<br>
; relativeTo
relativePoint: attachment point for the 'relativeTo' frame<br>
: 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: x offset<br>
; relativePoint
yOfs: y offset<br>
: [[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()<br>
point, relativeTo, relativePoint, xOfs, yOfs = MyAddon_Frame1:GetPoint()
DEFAULT_CHAT_FRAME:AddMessage(point)<br>
DEFAULT_CHAT_FRAME:AddMessage(point)
DEFAULT_CHAT_FRAME:AddMessage(relativeTo:GetName())<br>
DEFAULT_CHAT_FRAME:AddMessage(relativeTo:GetName())
DEFAULT_CHAT_FRAME:AddMessage(relativePoint)<br>
DEFAULT_CHAT_FRAME:AddMessage(relativePoint)
DEFAULT_CHAT_FRAME:AddMessage(xOfs)<br>
DEFAULT_CHAT_FRAME:AddMessage(xOfs)
DEFAULT_CHAT_FRAME:AddMessage(yOfs)<br>
DEFAULT_CHAT_FRAME:AddMessage(yOfs)


== Result ==
Result:


TOP<br>
TOP
MyAddon_Frame0<br>
MyAddon_Frame0
BOTTOM<br>
BOTTOM
0<br>
0
-10<br>
-10

Revision as of 01:41, 27 September 2007

Widget API ← Region < GetPoint

Returns information about the anchor points for a region.

point, relativeTo, relativePoint, xOfs, yOfs = MyRegion:GetPoint(n)

Arguments

n
integer - number of point about which you want to retrieve info. Should be in range 1 .. MyRegion:GetNumPoints()

Returns

point
FramePoint -- attachment point of frame MyFrame
relativeTo
Region -- The frame MyFrame is attached to (NOTE: this returns the actual widget object, if you want to get that object's name, use relativeTo:GetName())
relativePoint
FramePoint -- attachment point of the relativeTo frame
xOfs
number -- horizontal offset; not necessarily integer (positive xOfs means shift to the right)
yOfs
number -- vertical offset; not necessarily integer (positive yOfs means shift upwards)

Example

point, relativeTo, relativePoint, xOfs, yOfs = MyAddon_Frame1:GetPoint()
DEFAULT_CHAT_FRAME:AddMessage(point)
DEFAULT_CHAT_FRAME:AddMessage(relativeTo:GetName())
DEFAULT_CHAT_FRAME:AddMessage(relativePoint)
DEFAULT_CHAT_FRAME:AddMessage(xOfs)
DEFAULT_CHAT_FRAME:AddMessage(yOfs)

Result:

TOP
MyAddon_Frame0
BOTTOM
0
-10