S
Sarena
Guest
I set up a health bar to go along with my player's hp (which is 4), but for some reason the health bar image itself is acting as if my player only has 3 hp.
I attached an image to showcase the issue.
Here is my objGUI's Create Event:
And the Draw GUI Event:
I attached an image to showcase the issue.
Here is my objGUI's Create Event:
Code:
// Set Global Variable
global.playerhp = 4;
Code:
// Draw Sprite
draw_sprite(sprHPBackground, 0, view_xview[0] + 30, view_yview[0] + 50);
// Draw Sprite Transformed
draw_sprite_ext(sprHPBar, 0, view_xview[0] + 30, view_yview[0] + 50, global.playerhp / 4, 1, 0, $FFFFFFFF & $ffffff, ($FFFFFFFF >> 24) / $ff);
// Draw Sprite
draw_sprite(sprHPBorder, 0, view_xview[0] + 30, view_yview[0] + 50);
// If Variable
if(global.playerhp <= 0)
{
// Destroy Instance
instance_destroy();
}
Attachments
-
21.2 KB Views: 26