Thread: Template frames
View Single Post
09-24-08, 04:19 PM   #2
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
This code snippet shows a simple frame:

Code:
local f = CreateFrame("Frame", "myFrame", UIParent)
f:SetFrameStrata("MEDIUM")
f:SetWidth(200)  
f:SetHeight(200) 
f:SetScript("OnDragStart", function() getglobal("myFrame"):StartMoving() end)
f:SetScript("OnDragStop", function() getglobal("myFrame"):StopMovingOrSizing() end)
f:SetPoint("CENTER",0,0)
f:SetBackdrop({bgFile="Interface\\DialogFrame\\UI-DialogBox-Background", edgeFile="Interface\\Tooltips\\UI-Tooltip-Border", tile = false, tileSize = 0, edgeSize = 16, insets = { left = 0, right = 0, top = 0, bottom = 0 }})
f:SetMovable(true)
f:EnableMouse(true)
f:SetClampedToScreen(true)
f:RegisterForDrag("LeftButton")
f:Show()
  Reply With Quote