Vertical healthbar

Posted By: Realspawn

Vertical healthbar - 10/14/17 18:21

For my lite_c library I have a part about healhtbars.
I use this for a vertical healthbar

Code:
BMAP* hb_map = "health.png";
PANEL* hb_pan = 
{
vbar = 836, 55, 255,hb_map, 1, health;
layer = 5;
flags =  SHOW;

}




The healhbar goes down in the wrong direction from bottom to top
how to make it work from top to bottom ? Do i somehow need to rotate the healthbar laugh

Many thanks
Posted By: DriftWood

Re: Vertical healthbar - 10/14/17 18:24

You need to change the function moving the bar.

Like if it's vbar+=5; make it -=5;

Wait - What is vbar anyway? Is it not supposed to be a window?
Posted By: Realspawn

Re: Vertical healthbar - 10/14/17 18:41

I am using the old way if there is a better way i surely want to know laugh

The healthbar as it is works but it should become shorter from the top instead from the bottom.
Posted By: DriftWood

Re: Vertical healthbar - 10/14/17 22:16

Send me you're code and key and I'll fix it. Like the last decade.

My name is MALICE!
Posted By: Realspawn

Re: Vertical healthbar - 10/15/17 04:23

the lost soul is back.

the code is in here. I did a search and the question is asked several times in the forum so far no clear solution even not in one of the
aum's. Point is it works it needs to go reverse thats all laugh

Posted By: Kartoffel

Re: Vertical healthbar - 10/15/17 08:23

The positionn of a panel describes where the top left pixel is. One way to do it is changing the position according to the scale: If your healthbar is 100 pixels high at max but only filled to 50 right now you have to move the panel downwards by the remaining 50 pixels.
Posted By: Realspawn

Re: Vertical healthbar - 10/15/17 08:57

Thank you Kartoffel laugh I see how it works now.

Every time i subtract health i lower the position

health -=13;
 hb_pan->pos_y += 13;

works like a charm thank you for your help.

© 2024 lite-C Forums