View Single Post
12-23-13, 08:33 AM   #11
10leej
A Molten Giant
 
10leej's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2011
Posts: 583
Originally Posted by Phanx View Post
1) Just start by making a frame.
Code:
local function Spawn(frame, unit, isSingle)
    frame:SetPoint("CENTER", UIParent)
    frame:SetSize(100, 25)

    local bg = frame:CreateTexture(nil, "BACKGROUND")
    bg:SetAllPoints(true)
    bg:SetTexture(0, 0, 0, 0.5)
    frame.bg = bg
end

oUF:RegisterLayout("10leej", Spawn)
oUF:SetActiveLayout("10leej")
oUF:Spawn("player")
Then add something else to it, like a name:
Code:
    frame.bg = bg

    local name = frame:CreateFontString(nil, "OVERLAY", "GameFontNormal")
    name:SetPoint("BOTTOM", frame, "TOP")
    self:Tag(name, "[name]")
    frame.Name = name
end
Then move on to other stuff, like a health bar, power bar, etc.



Have you looked at the Blizzard UI code? There's not much efficiency to be found in there.


Well if your just changing the texture and bar sizes its efficient enough for me.
__________________
Tweets YouTube Website
  Reply With Quote