• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Question - Code DnD Draw Healthbar only visible on exit [SOLVED]

S

ShampooDance

Guest
First off, apologies if this should have been posted in the general Programming forum -- the rules for this forum say that questions should be posted here if they pertain to GMS2-specific functionality, and there was no DnD Draw Healthbar function that I was able to find in GM:S 1.4.

On to my issue: The bar drawn by Draw Healthbar is only visible when the user hits Esc to exit the game. I managed to grab a screenshot of it drawn during the <1 second after Esc is registered and before the window is totally removed, which I've attached in addition to screenshots of how the object instance normally looks during gameplay, as well as screenshots of the pertinent logic for this object.

Initially I thought the bar might have been drawn on a layer below the Instance layer the player object is located on, but I've been all up and through the documentation and was unable to find any way to adjust that, if true. I'm pretty sure this isn't a bug and is just something I'm missing/failing to understand about the Draw Healthbar function, and any help y'all might be able to provide would be greatly appreciated.

logic: healthbar1.png healthbar2.png
no healthbar during gameplay: healthbar3.png
healthbar visible for 1 frame during shutdown: healthbar4.png
 
S

ShampooDance

Guest
Draw Healthbar should be used in a Draw event, and it would make most sense to put it in a Draw GUI event.
And there's the thing I didn't understand. Thank you!
 
Top