Drawing hp bars from top to bottom

Hey!

I need to create vertical HP and MP bars for my game.

My code:


    HPBar = 94 * (GetPlayerVital(MyIndex, Vitals.HP) / GetPlayerMaxVital(MyIndex, Vitals.HP))
    HPBar = 94 - HPBar

    RenderTexture Tex_GUI(1), 0, 16 + HPBar, 0, HPBar, 94, 94, 94, 94

But it only shows HP bar picture when HP > 123. If hp =< 123, hp bar is unvisible.

Any ideas?

Ok I found what is wrong, in Sub RenderTexture i found:


    If sY + sHeight > textureHeight Then Exit Sub

But when I remove it it drawing second HP bar under first.

Maybe I should use RenderTextureByRects but i don’t know how to use it xD

Log in to reply