I am completely at a loss trying to understand bar heights in pitbull4.
I understand you explicitly state the width/height of a frame (e.g. the player frame). You then use the sliders to state the height of the bars within the frame (health, power, blank etc) and it states on the slider that the height is how much taller the bar should be in relation to other bars, but when there are 4 such bars, I'm completely confused as to how to get a given bar where I want it.
The reason that I ask is I want to do something similar to LUI, as shown here:
There are 4 blank space bars, stacked vertically upon each other. The first is light grey, and the other three below. The third and fourth have the health and power texts anchored to them respectively, allowing to seem to stack outside the player frame.
Could someone help me get my head around calculating how much actual space a bar will take up when you use a slider to adjust it's height, given that the unit frames height is already.
I'm sorry, but how do you know that those are blank space bars? Looks to me like the text is just anchored outside of the frame. (Either 2 texts with different offsets, or one text area displaying both health and mana with a line break in between.)
I have upped the transparency from 0% on the blank bars.
Blank 1 - bright grey, 100% opacity.
Blank 2,3,4 - 0% opacity. As you can see the hp/power text sit in 3 and 4 respectively, 2 being used as a spacer.
The Border that you see is actually a kgpanel panel anchored to the pitbull player frame. The panel is not actually as high as the whole pitbull player frame, just the part visible to the player, creating the impression that's where the frame finishes.
I don't think those are blank bars. The border going around the first 3 bars is a dead giveaway that the frame ends there.
What you can do is create a lua text and position it "Outside, below-right" (or below-left for the target frame), attached to the unitframe. By adding \n in the return string, you can generate a 2-line text. This will do it:
return "%s\n%s",HP(unit),Power(unit)
Obviously the code would need fleshed out to achieve the class-coloring shown in your screenshot above. You might need to use some spaces in there to line it up better as well. A quick test on my computer shows that it's possible.
But, I have to ask... if this is from a UI pack, why not download it and see how it's done? Or if that can't be done, contact the player?
They're definitely blank bars. I am using LUI so that's how I created the screenshot, by amending the opacity of the blank bars, and illustrating it with the text.
However I have solved the problem by cobbling this together, so I can get rid of the need to use blank bars:
local max = Power(unit)
if max > 0 then
local cr,cg,cb = ClassColor(unit)
return "%s\n|cff%02x%02x%02x%s|r",HP(unit),cr,cg,cb,Power(unit)
end
not originally my code, but amended by me. Here's the result:
Also thanks, your comment helped me work out how to do this.
One final question, can texts be absolutely positioned or offset to a pixel spec? I.e. it's possible to offset bars, but what about texts?
I understand you explicitly state the width/height of a frame (e.g. the player frame). You then use the sliders to state the height of the bars within the frame (health, power, blank etc) and it states on the slider that the height is how much taller the bar should be in relation to other bars, but when there are 4 such bars, I'm completely confused as to how to get a given bar where I want it.
The reason that I ask is I want to do something similar to LUI, as shown here:
http://s.wowinterface.com/preview/pvw31887.jpg
There are 4 blank space bars, stacked vertically upon each other. The first is light grey, and the other three below. The third and fourth have the health and power texts anchored to them respectively, allowing to seem to stack outside the player frame.
Could someone help me get my head around calculating how much actual space a bar will take up when you use a slider to adjust it's height, given that the unit frames height is already.
Phew, hope that made sense.
I have upped the transparency from 0% on the blank bars.
Blank 1 - bright grey, 100% opacity.
Blank 2,3,4 - 0% opacity. As you can see the hp/power text sit in 3 and 4 respectively, 2 being used as a spacer.
The Border that you see is actually a kgpanel panel anchored to the pitbull player frame. The panel is not actually as high as the whole pitbull player frame, just the part visible to the player, creating the impression that's where the frame finishes.
Also, is it possible to offset texts?
What you can do is create a lua text and position it "Outside, below-right" (or below-left for the target frame), attached to the unitframe. By adding \n in the return string, you can generate a 2-line text. This will do it:
return "%s\n%s",HP(unit),Power(unit)
Obviously the code would need fleshed out to achieve the class-coloring shown in your screenshot above. You might need to use some spaces in there to line it up better as well. A quick test on my computer shows that it's possible.
But, I have to ask... if this is from a UI pack, why not download it and see how it's done? Or if that can't be done, contact the player?
However I have solved the problem by cobbling this together, so I can get rid of the need to use blank bars:
not originally my code, but amended by me. Here's the result:
Also thanks, your comment helped me work out how to do this.
One final question, can texts be absolutely positioned or offset to a pixel spec? I.e. it's possible to offset bars, but what about texts?