View Single Post
12-23-13, 01:07 PM   #1
10leej
A Molten Giant
 
10leej's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2011
Posts: 583
Trying my hand at ouf

So in this thread Phanx reinspired me to try my hand at making an ouf layout.

So far though I'm trying just to make a player health bar and all I get is just the backround and no status bar. According to the documentation I found in ouf itself the healthbar should default to the standard health bar is you don't imply a texture or color to it. So i'm confused.

code:
Code:
local frame = CreateFrame("Frame", "Bob", UIParent)

frame:SetPoint("CENTER",UIParent,0,0)

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:RegisterStyle("Bob", Spawn)
oUF:Spawn("player")

-- Position and size
local Health = CreateFrame("StatusBar", nil, frame)
Health:SetHeight(20)
Health:SetPoint('TOP')
Health:SetPoint('LEFT')
Health:SetPoint('RIGHT')

-- Options
Health.frequentUpdates = true
Health.colorTapping = true
Health.colorDisconnected = true
Health.colorClass = true
Health.colorReaction = true
Health.colorHealth = true

-- Register it with oUF
frame.Health = Health
frame.Health.bg = Background
__________________
Tweets YouTube Website
  Reply With Quote