WoW:API Region SetPoint
Jump to navigation
Jump to search
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, or the screen (not UIParent) when obj does not have a parent
- 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
- units are relative to the screen with the frame's effective scale.
- y
- the Y offset (-5 means 5 units down, 5 means 5 units up)
- defaults to 0 when not specified
- units are relative to the screen with the frame's effective scale.
- 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.
- Note
You will have to do a
obj:ClearAllPoints()
before using obj:SetPoint(...), if you expect the frame to actually move.
Maisha
Template:WoW API