Text Frame

From Riftui Wiki

Jump to: navigation, search

A Text Frame is a special type of Frame that introduces new functions for rendering text.

It is important to note that the height and width of the text is separate from the height and width of the frame. It is recommended that you use the functions Text:GetFullWidth(), Text:GetFullHeight(), or Text:ResizeToText() to resize the frame to the size of the text so cropping does not occur.

Contents

Creation

See UI.CreateFrame()

Methods

Inherits all functions from Frame and includes new methods:

Events

Inherits all Events from Frame.

Example

-- Create our context --
local context = UI.CreateContext("SampleContext")
-- Create our text frame --
local text = UI.CreateFrame("Text", "SampleText", context)
-- Hello World! --
text:SetText("Hello World!")
-- Change the dimensions so all text is visible --
text:SetWidth(text:GetFullWidth())
text:SetHeight(text:GetHeight())
-- Put it at the top center of the game --
text:SetPoint("TOPCENTER", UIParent, "TOPCENTER")
Personal tools
Namespaces
Variants
Actions
Menu
Wiki
Toolbox