View Single Post
03-23-09, 07:08 AM   #940
Luzzifus
A Warpwood Thunder Caller
 
Luzzifus's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2007
Posts: 94
Not if you create the SafeZone after the Background. Also you can always set a frame-level to have it on top of the BG.

This is my whole castbar-code and it works perfectly:
Code:
self.Castbar = CreateFrame("StatusBar")
self.Castbar:SetBackdrop({bgFile="Interface\\Tooltips\\UI-Tooltip-Background", insets ={left = -1, right = -1, top = -1, bottom = -1}})
self.Castbar:SetBackdropColor(nivDB.colorBD.r, nivDB.colorBD.g, nivDB.colorBD.b, nivDB.colorBD.a)
self.Castbar:SetWidth(nivcfgDB.castbarWidth)
if (unit=="player") then
	self.Castbar:SetHeight(20)
	self.Castbar:SetPoint("CENTER", UIParent, "CENTER", nivcfgDB.castbarX, nivcfgDB.castbarY)
else
	self.Castbar:SetHeight(10)
	self.Castbar:SetPoint("CENTER", UIParent, "CENTER", nivcfgDB.castbarX, nivcfgDB.castbarY - 17)
end
self.Castbar:SetStatusBarTexture(nivDB.texStrHealth)
self.Castbar:SetStatusBarColor(nivcfgDB.colorHealth.r, nivcfgDB.colorHealth.g, nivcfgDB.colorHealth.b, nivvcfgDB.colorHealth.a)	
self.Castbar:SetParent(self)
self.Castbar:SetMinMaxValues(1, 100)
self.Castbar:SetValue(1)
self.Castbar:Hide()  
self.Castbar.bg = self.Castbar:CreateTexture(nil, "BORDER")
self.Castbar.bg:SetAllPoints(self.Castbar)
self.Castbar.bg:SetTexture("Interface\\AddOns\\oUF_Nivaya\\textures\\Minimalist")
self.Castbar.bg:SetAlpha(0.05)	
self.Castbar.Time = self.Castbar:CreateFontString(nil, "OVERLAY")
self.Castbar.Time:SetPoint("RIGHT", self.Castbar, -2, 0)
self.Castbar.Time:SetFont(nivDB.fontStrValues, nivcfgDB.fontHeightV)
self.Castbar.Time:SetTextColor(1, 1, 1)
self.Castbar.Time:SetJustifyH("RIGHT")
self.Castbar.Text = self.Castbar:CreateFontString(nil, "OVERLAY")
self.Castbar.Text:SetPoint("LEFT", self.Castbar, 2, 0)
self.Castbar.Text:SetWidth(240)
self.Castbar.Text:SetFont(nivDB.fontStrNames, nivcfgDB.fontHeightN)
self.Castbar.Text:SetTextColor(1, 1, 1)
self.Castbar.Text:SetJustifyH("LEFT")
		
if (unit=="player") then
	self.Castbar.Time:SetTextHeight(nivcfgDB.fontHeightV+2)
	self.Castbar.Text:SetTextHeight(nivcfgDB.fontHeightN+2)			
else
	self.Castbar.Time:SetTextHeight(nivcfgDB.fontHeightV)
	self.Castbar.Text:SetTextHeight(nivcfgDB.fontHeightN)			
end

self.Castbar.SafeZone = self.Castbar:CreateTexture(nil,"BORDER")
self.Castbar.SafeZone:SetTexture(nivDB.texStrHealth)
self.Castbar.SafeZone:SetVertexColor(1,1,1,0.7)
self.Castbar.SafeZone:SetPoint("TOPRIGHT")
self.Castbar.SafeZone:SetPoint("BOTTOMRIGHT")

Last edited by Luzzifus : 03-23-09 at 12:30 PM.