Widget/API/GetAnchor

__NOTOC__
Returns an anchor of a widget.
point, relativePoint, relativeTo, offsetX, offsetY = MyWidget:GetAnchor( [index] )
== Parameters ==
=== Arguments ===
:;index
::number - Index of anchor to get information of. (optional)
:::Index value starts at 0.
:::If this parameter is not provided, the index defaults to 0.
=== Returns ===
:;point
::string - The point on the widget which is anchored (LEFT, RIGHT, BOTTOM, TOP, CENTER, BOTTOMLEFT, BOTTOMRIGHT, TOPLEFT, TOPRIGHT).
:;relativePoint
::string - The point on the relative widget which is anchored (LEFT, RIGHT, BOTTOM, TOP, CENTER, BOTTOMLEFT, BOTTOMRIGHT, TOPLEFT, TOPRIGHT).
:;relativeTo
::widget - The object of the relative widget.
:;offsetX
::The offset on the x axis 
:;offsetY 
::The offset on the y axis 
== Example ==
--Convert Frame Userdata into savable data
function myWidget_SetSavableFrameInfo(frame, target)
	if not frame then
		return false
	elseif not target then
		target = frame
	end
	target.Anchor = {}
	target.Anchor.point,
	target.Anchor.relativePoint,
	target.Anchor.relativeTo,
	target.Anchor.offsetX,
	target.Anchor.offsetY = frame:GetAnchor()
	if not relativeTo then
		target.Anchor.relativeTo = frame:GetParent()
	end
	target.Anchor.relativeTo = target.Anchor.relativeTo:GetName()
	
	target.Size = {}
	target.Size.X, target.Size.Y = frame:GetSize()
	return true
end
== Notes ==
* The Anchor returned could have nothing to do with the anchor originally set. For instance, frames off of ParentUI tend to always return their anchor in Relation to the TOPLEFT of both frames. 
== Widgets With This Method ==
== Related Methods ==
* ClearAllAnchors
* GetAnchorOffset
* GetHeight
* GetSize
* GetWidth
* SetAnchor
* SetAnchors
* SetHeight
* SetSize
* SetTextAnchor
* SetWidth
== Related Pages==
*Widget (Overview)
Category:Widget/API Category:Widget/Class/Layout