Health and Sprint bar questions

I have a vertical health bar, and I have one problem with it.



		draw.RoundedBox( 0, 8, 6, 4, ( 175 * playerhealth ) + 0, Color( 195, 0, 0, 255 ) );


It takes the health from the bottom instead of the top, can someone edit this please?

Now the stamina/sprint bar, is there anything out there to help me create a sprint/stamina system?

Change your y position to this:
6 + ( 175 - 175 * playerhealth )

Assuming that playerhealth is a ratio.

Thanks but it seems to glitch alot, like, taking a small amount away from the bottom or adding some to the bottom.

That’s because you’re using weird numbers. Use a number that is divisible by 2, an even number.
something like 200 instead of 175.

Draw.RoundedBox() with 0 border size? I wonder if that causes the glitch. You should try surface.DrawRect() instead of that. Just make sure you set a color with surface.SetDrawColor() before drawing the rect.

I took CowThing’s advice and it works.