Texture Frame

From Riftui Wiki

Jump to: navigation, search

A Texture Frame is a special type of Frame that introduces new functions for rendering image files. Currently only JPG, DDS, PNG, and TGA are supported image types.

It is important to note that the texture will be resized to fit the frame. To set the size of the frame to match exactly to the size of the texture, ResizeToTexture() is used.

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 texture = UI.CreateFrame("Texture", "SampleTexture", context)
-- This will load a file named "sample.jpg" in your addon's directory --
texture:SetTexture("addondir", "sample.jpg")
-- Sets the Texture frame size to the dimensions of the loaded file --
texture:ResizeToTexture()
-- Put it at the top center of the game --
texture:SetPoint("TOPCENTER", UIParent, "TOPCENTER")
Personal tools
Namespaces
Variants
Actions
Menu
Wiki
Toolbox