Frames

From Riftui Wiki

Jump to: navigation, search

Frames are the building blocks for an Addon's UI. Each frame is a single graphical element. Basic frames can be colors, textures, or overlays; complex controls like text boxes, interactive fields, etc, are really composite elements composed of multiple frames. Frames interact with the game through events (incoming actions) and API calls (outgoing actions).

Every frame must have a parent, and because of this, a context must be created before any frames can be created. See Context for information about creating a context.

Contents

Creation

A frame is created by the function UI.CreateFrame(). It is common practice to build frames when the Event.Addon.Load.Begin event fires.

Types

Methods

It inherits all functions from Layout, including the following functions:

Events

It inherits all events from Layout and includes the following functions below:

Example

-- Create our context --
local context = UI.CreateContext("SampleContext")
 
-- Create and attach the frame to the context --
local sample = UI.CreateFrame("Frame", "SampleFrame", context)
 
-- Set the frame to the top center of the game --
sample:SetPoint("TOPCENTER", UIParent, "TOPCENTER")
 
-- Give the frame a solid black background --
sample:SetBackgroundColor(0, 0, 0, 1)
Personal tools
Namespaces
Variants
Actions
Menu
Wiki
Toolbox