View Single Post
03-19-16, 09:52 AM   #12
Folji
A Flamescale Wyrmkin
 
Folji's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 136
Originally Posted by syncrow View Post
you have to create a texture on top of the statusbar instead of using :SetStatusBarTexture()
How so, exactly? I'm hunching that the way I've done it here is not quite how you mean with that, because this just seems to create a white texture frame underneath the bar.

Lua Code:
  1. lib.CreateHealth = function(frame,unit,width,height,point,x,y)
  2.  
  3.     local hp = CreateFrame('StatusBar', nil, frame)
  4.     hp:SetSize(width,height)
  5.     hp:SetPoint(point,frame,x,y)
  6.     hp:SetFrameLevel(2)
  7.  
  8.     local bar = hp:CreateTexture(nil, 'ARTWORK')
  9.     bar:SetAllPoints(hp)
  10.     bar:SetTexture('Interface\\TargetingFrame\\UI-StatusBar')
  11.  
  12.     if (unit == 'target') then
  13.         hp:SetReverseFill(true)
  14.     end
  15.  
  16.     -- Register it with oUF
  17.     frame.Health = hp
  18.  
  19. end
  Reply With Quote