Frame:SetPoint()

From Riftui Wiki

Jump to: navigation, search
Frame points
Frame points
How Frame:SetPoint() affects relative position of frames

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.

Contents

Possible Points

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.

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.

Signature

frame:SetPoint(point, frame, point [, x, y])

Parameters

Return Value

None

Simple Example

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")
Personal tools
Namespaces
Variants
Actions
Menu
Wiki
Toolbox