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:
-- Set up the BarTexture Position
--newFrame.Bar:ClearAllPoints()
--newFrame.Bar:SetPoint("LEFT",newFrame,"LEFT",0,0)
--newFrame.Bar:SetWidth(50)
newFrame:SetStatusBarTexture("Interface/TargetingFrame/UI-StatusBar")
newFrame:SetStatusBarColor(0, 1, 0)
newFrame:SetMinMaxValues(0, 1)
newFrame:SetValue(0)
And the following in UpdateBarTexture
Lua Code:
--unitFrame.HealthBar.Bar:SetWidth(offset * activeLayout.width)
--unitFrame.HealthBar.Bar:SetColorTexture(r,g,b,1)
unitFrame.HealthBar:SetStatusBarColor(r,g,b)
unitFrame.HealthBar:SetMinMaxValues(0, maxHealth)
unitFrame.HealthBar:SetValue(health)
The bar is shrinking and the color is changing as expected. Thanks for the reminder though.