WoW:API Region SetPoint: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
(updated argument list and listed defaults for arguments that are not specified)
m (reworded point arg description)
Line 15: Line 15:


; point  
; point  
: the point to attach the obj to (see [[API Positions]])  (i.e.  bind the left side of your frame)
: the point on your object to use for attaching the obj (see [[API Positions]])  (i.e.  bind the left side of your frame)


; frame  
; frame  

Revision as of 05:19, 4 January 2006

SetPoint -Documentation by Sarf-

Sets the current attachment point of an UI component. Any of the following formats are valid

obj:SetPoint(point);
obj:SetPoint(point, frame);
obj:SetPoint(point, frame, relativePoint);
obj:SetPoint(point, x, y);
obj:SetPoint(point, frame, relativePoint , x, y);



Arguments
point
the point on your object to use for attaching the obj (see API Positions) (i.e. bind the left side of your frame)
frame
the name of the frame to attach the obj to, an actual frame variable can also be used (can be "UIParent" to attach it to the screen itself)
defaults to the parent of obj when not specified
relativePoint
the relative point to attach the obj to (see API Positions) (i.e. bind your frame to the left side of the parent)
defaults to the value of point when not specified
x
the X offset (-5 means 5 units left, 5 means 5 units right)
defaults to 0 when not specified
y
the Y offset (-5 means 5 units down, 5 means 5 units up)
defaults to 0 when not specified

Returns
nil

Examples

The following are all equivalent.

MainMenuBar:SetPoint("BOTTOMLEFT", "UIParent", "BOTTOMLEFT", 0, 0);
MainMenuBar:SetPoint("BOTTOMLEFT", UIParent, "BOTTOMLEFT", 0, 0);
MainMenuBar:SetPoint("BOTTOMLEFT", "UIParent", "BOTTOMLEFT");
MainMenuBar:SetPoint("BOTTOMLEFT", "UIParent");

The following is equivalent to the above, given that the parent frame of MainMenuBar is UIParent.

MainMenuBar:SetPoint("BOTTOMLEFT");
MainMenuBar:SetPoint("BOTTOMLEFT", 0, 0);
Result

Description
Attaches obj to the specified position.

Template:WoW API