• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

[SOLVED] Font size error when switching between rooms

Draw code for obj_life_display looks like this and shows the "2" in the heart:

Code:
draw_set_font(f_large);
draw_set_color(c_white);

draw_text(x, y, string(global.save_lives));
Draw GUI code for "obj_life_display" looks like this and shows the timer:

Code:
if (global.save_lives != global.save_lives_pool)
{
    draw_set_font(f_small);
    draw_set_color(c_white);
    
    draw_text(x + 75, y, string_hash_to_newline(string(floor(wfl_minutes))) + "m " + string_hash_to_newline(string(floor(wfl_seconds))) + "s");   
}
Outcome is this:


With the same object but in the actual level room the outcome is this:


But then when exiting the level room back to the level select it displays correctly, like this:


The size and position are both wrong in the first image. I don't even know where to start with this. What am I doing wrong?
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Check the size of the GUI layer and make sure it's the same size in all rooms and if not use display_set_gui_size() to make it consistent (you only need to call this once at the start of the game, BUT if your rooms are different sizes, then you meed need to call it at the start of each room, in the room start event of a controller, for example).
 
Top