Thread Tools Display Modes
04-15-24, 12:16 PM   #1
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 6,007
That is a good point. I totally forgot it didn't have a height either.

But, I somehow managed to get things to work again as a status bar.

Can't think what is different outside of using a different texture. Instead of setting BarTexture in the xml to an atlas ( example from one of the blizzard files) , I used SetStatusBarTexture with the texture used in the example here ( https://warcraft.wiki.gg/wiki/UIOBJECT_StatusBar ).

I changed the following in ApplyLayout after changing the Frame to StatusBar in the xml and removing the alternative bar texture section.
Lua Code:
  1. -- Set up the BarTexture Position
  2.     --newFrame.Bar:ClearAllPoints()
  3.     --newFrame.Bar:SetPoint("LEFT",newFrame,"LEFT",0,0)
  4.     --newFrame.Bar:SetWidth(50)
  5.    
  6.     newFrame:SetStatusBarTexture("Interface/TargetingFrame/UI-StatusBar")
  7.     newFrame:SetStatusBarColor(0, 1, 0)
  8.     newFrame:SetMinMaxValues(0, 1)
  9.     newFrame:SetValue(0)

And the following in UpdateBarTexture
Lua Code:
  1. --unitFrame.HealthBar.Bar:SetWidth(offset * activeLayout.width)
  2.     --unitFrame.HealthBar.Bar:SetColorTexture(r,g,b,1)    
  3.    
  4.     unitFrame.HealthBar:SetStatusBarColor(r,g,b)
  5.     unitFrame.HealthBar:SetMinMaxValues(0, maxHealth)
  6.     unitFrame.HealthBar:SetValue(health)

The bar is shrinking and the color is changing as expected. Thanks for the reminder though.
__________________


All Level 70 Characters:
Demon Warlock
Resto Druid
Disc Priest
Resto Shaman
Survival Hunter
Augment Evoker
Frost Mage
Vengence Demon Hunter
Rogue ( was subtlety )

Brewmaster Monk (TR)
Prot Paladin (TR)
Blood Death Knight ( TR)

As you can see I am missing a warrior

And .. I don't have all the allied races covered. Time Runner time when it happens again

  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » StatusBar / Texture - Width/Coloring issues


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off