From Riftui Wiki
A complex function that positions a frame as well as alters its size. A frame has 9 points: TOPLEFT, TOPCENTER, TOPRIGHT, RIGHT, BOTTOMRIGHT, BOTTOMCENTER, BOTTOMLEFT, LEFT, and CENTER. Any point of a frame can be bound to another point of a frame. There are no parent or child restrictions. It's highly recommended to view examples of the use of this function to fully understand what it does.
Below is a list of possible points that can be bound. Keep in mind that there may be limitations such as LEFT and RIGHT will result in an error if passed with the optional offset values.
- XCENTER / CENTERX
- YCENTER / CENTERY
Points are passed as strings. See the example below.
In fact, points are only a shorthand for their represented relative coordinates. "TOPLEFT" means x=0, y=0. Whenever dealing with points, it is possible to use the two values for x and y. See the examples below for multiple ways to use these.
frame:SetPoint(point, frame, point [, x, y])
- point (string) - The point of the current frame you wish to bind.
- frame (layout, context, frame) - A reference to the frame, context, or layout you wish to bind it to. This may also be UIParent.
- point (string) - The point of the referenced frame you wish to bind it to.
- x (number) - The X offset from the reference point.
- y (number) - The Y offset from the reference point.
local context = UI.CreateContext("SampleContext") local frame = UI.CreateFrame("Frame", "SampleFrame", context) -- Set the TOPLEFT point to the TOPLEFT of the user's screen -- frame:SetPoint("TOPLEFT", UIParent, "TOPLEFT")