1. Post #1
    Dennab
    May 2009
    9 Posts
    I have a vertical health bar, and I have one problem with it.
    Code:
    		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?

  2. Post #2
    Yobdren's Avatar
    June 2008
    2,394 Posts
    Change your y position to this:
    6 + ( 175 - 175 * playerhealth )

    Assuming that playerhealth is a ratio.

  3. Post #3
    Dennab
    May 2009
    9 Posts
    Thanks but it seems to glitch alot, like, taking a small amount away from the bottom or adding some to the bottom.

  4. Post #4
    moo
    CowThing's Avatar
    November 2006
    4,581 Posts
    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.

  5. Post #5
    SFArial's Avatar
    May 2009
    1,023 Posts
    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.

  6. Post #6
    Dennab
    May 2009
    9 Posts
    I took CowThing's advice and it works.