
Originally Posted by
namad
Well, it was made the same way as native QL health/armor bars. They have separate bars for 100H and 200H. Your workaround is correct btw, not sure if I need to offer single bar since it's not that flexible as double one.
You can have same flexibility if you draw healthbars differently, using forecolor (this is drawn as soon as filled rectangle disappears) as background (e.g. forecolor .5 .5 .5 .3), defining colorranges as 1 200, 2 200, 3 200... 199 200, 200 200 instead of 0 1, 2 3... 98 99, 100 200, 102 103... 198 199, 200 201
Example:
1...100 hp is white; 101...200 hp is red; both use very transparent gray background .5 .5 .5 .3 (that's only drawn if filled rectangle disappears)
Code:
menuDef {
visible 1
rect 100 300 0 0
itemDef {
dc
visible 1
rect 0 0 2 5
style 1
background "ui/assets/score/statsfillm"
forecolor .5 .5 .5 .3
ownerdraw CG_PLAYER_HEALTH
addColorRange 1 200 .8 .8 .8 .8
}
itemDef {
dc
visible 1
rect 200 0 2 5
style 1
background "ui/assets/score/statsfillm"
forecolor .5 .5 .5 .3
ownerdraw CG_PLAYER_HEALTH
addColorRange 200 200 1 0 0 .8
}
}

Originally Posted by
namad
This is a pretty annoying issue, I know. But right now, original HUD parsed by QL engine is limited to 640x480 canvas. All elements are resized beased on current screen resolution. So, when you draw 1px line, on bigger screens it could be more that 1px (in my case, I'm using 1680x1050, so 1px line drawn as 2px line).
what about 1280x960 canvas? (twice as big as 640x480)