Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

1075919 Posts in 44152 Topics- by 36120 Members - Latest Member: Royalhandstudios

December 29, 2014, 03:33:37 PM
TIGSource ForumsDeveloperTechnical (Moderators: Glaiel-Gamer, ThemsAllTook)Keeping the HUD on top?
Pages: [1]
Print
Author Topic: Keeping the HUD on top?  (Read 531 times)
MartyMan
Level 0
***



View Profile
« on: May 23, 2010, 09:10:44 AM »

I switched to Game Maker very recently and so far it's gone smoothly, but today I've noticed this:



As you can see, those Spikes are on top of the HUD! I'm not sure what I can do about this. Concerned

I tried changing the depth of the object drawing the HUD, but it hasn't done anything. Is there anything I can do to ensure that the HUD stuff is drawn over everything else?

I guess just as a precaution, here's the code for the Draw Event.

Code:
global.CustomFont = font_add_sprite(sFont, ord(' '), false, 0);
global.DamageFont = font_add_sprite(sDamageFont, ord('-'), false, 0);

draw_set_font(global.CustomFont);

draw_sprite(hud_healthshadow, 0, view_xview[0]+8, view_yview[0]+18);
draw_sprite(hud_HealthBar, 0, view_xview[0]+8, view_yview[0]+16);
draw_set_color(c_white);
draw_text(view_xview[0]+8, view_yview[0]+18, string(player_health));
draw_text(view_xview[0]+8, view_yview[0]+8,"$");
draw_text(view_xview[0]+20, view_yview[0]+8,kron_amount);
draw_percentage_bar(view_xview[0]+28, view_yview[0]+20, 28, 7, global.playerhealth, global.playerhealthMAX)
Logged
pgil
Guest
« Reply #1 on: May 23, 2010, 09:17:42 AM »

Make the depth of the HUD object something like -100000. That way you won't accidentally give one of the playfield objects a lower depth.
Logged
MartyMan
Level 0
***



View Profile
« Reply #2 on: May 23, 2010, 09:20:23 AM »

Make the depth of the HUD object something like -100000. That way you won't accidentally give one of the playfield objects a lower depth.

Oh, set it to a negative integer? I only tried positive values. Embarrassed

Thank you!
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic