Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Drawing hp bars from top to bottom


Qazek
 Share

Recommended Posts

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?
Link to comment
Share on other sites

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
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...