R
ruwcom
Guest
Hello, so I been trying to set a custom health bar that is divided in a border, a green bar (for the life) and a red bar (to be under the green bar when it starts shrinking). I been trying multiple methods but nothing seems to work, right now this is the code I'm using:
This is all in a draw GUI event in the object for the GUI, hp is the current hp that changes went the character gets hit, and maxhp is the total.
the problem that I get is that, even when the red bar and the border align perfectly, they are more small than it should and in the other hand the green bar is a lot wider than it should.
I would prefer they all to have exactly the size of the sprites that they use, and also align correctly.
even with that the bar seems to get smaller just fine, the problems are the proportions.
I hope I made my problem clear, thanks.
Code:
/// Draw
// Draw Health Border
draw_sprite_ext(spr_lifebarborder, 0, 32, 32, 1, 1, image_angle, image_blend, 1);
//Draw Redbar
draw_sprite(spr_lifered,1,32,32);
// Draw Healthbar
draw_sprite_ext(spr_lifegreen, 0, 32, 32, (obj_play.hp / obj_play.maxhp) * 5,1, image_angle, image_blend, 1);
the problem that I get is that, even when the red bar and the border align perfectly, they are more small than it should and in the other hand the green bar is a lot wider than it should.
I would prefer they all to have exactly the size of the sprites that they use, and also align correctly.
even with that the bar seems to get smaller just fine, the problems are the proportions.
I hope I made my problem clear, thanks.