• 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!

weird alpha during pause?

Hey, so I implemented pause in my game with following codes:

obj_pause:

Create
GML:
paused = false;
scrn = -1;
Alarm 0
GML:
scrn = sprite_create_from_surface(application_surface,0,0,surface_get_width(application_surface),surface_get_height(application_surface),0,1,0,0);
instance_deactivate_all(true);
Step
GML:
if(keyboard_check_pressed(vk_f3))
    {
    paused = !paused;
    if instance_number(announcement_displayer)>0{
    ds_queue_clear(global.notificationQueue);
    announcement_displayer.showingNotification = false;}
    alarm[0]=1
    }
if !paused{
if sprite_exists(scrn){
        sprite_delete(scrn);
        instance_activate_all();
    }
}
Draw Gui
GML:
if paused{
if sprite_exists(scrn){
    var w = display_get_gui_width(), h = display_get_gui_height();
    draw_sprite(scrn,0,0,0);
    
    draw_set_halign(fa_center);
    draw_set_font(font4)
    draw_text_outline3(view_wview/2,50,"Paused",c_white,c_black);
}
}
The Alarm exists cause I had problems before with making texts disappear from screen when pausing the game. It works fine when I make the texts disappear before the alarm event plays out and then the surface is drawn and all is deactivated, so thats working good, for some reason didn't work when the code in the Alarm event was displayed at the end of the current code in Step.
Now tho, a weird alpha appears when i pause the game; it makes everything a bit transparent, and it just looks real silly, especially since some objects (ones with their sprites being blurred from the edges for example) really show the transparency.
Any ideas why its happening?

thanks beforehand!
 
SOLVED! all i had to do was:

GML:
draw_enable_alphablend(false);
draw_sprite(scrn,0,0,0);
draw_enable_alphablend(true);
alter the part of Draw event in this way.
 
Top