View Single Post
12-23-13, 05:00 AM   #10
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by 10leej View Post
Honestly for our the only thing stopping me from making my own layout is that I literally have no idea where to start.
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.

Originally Posted by 10leej View Post
Plus I like the efficiency of modifying the blizzard frames....
Have you looked at the Blizzard UI code? There's not much efficiency to be found in there.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote