ikonhero
Member
Hi,
I'm trying to make my game freeze / pause by deactivating all instances from a seperate pause instance. Before deactivating all instances I make a copy of the application surface.
After all instances are deactivated I draw this surface in the draw event of the oPause instance.
However, the image appears to be zoomed in quite a lot. I get to see a bunch if pixels from the top left corner of the screen all stretched out.
I tried using both the surface method as well as the sprite creation method. Both render the same results.
Here's my code just to be sure:
As you can see I tried forcing the target surface to be the size of the application surface. But once it's drawn it shows up all zoomed in.
Some other info, as I assume it has to do with this:
room size: 270x100
view and viewport sizes: 160x90
game runs with fullscreen started.
Any idea what I'm doing wrong here?
Thanks!!!
Screenshot of paused screen:
I'm trying to make my game freeze / pause by deactivating all instances from a seperate pause instance. Before deactivating all instances I make a copy of the application surface.
After all instances are deactivated I draw this surface in the draw event of the oPause instance.
However, the image appears to be zoomed in quite a lot. I get to see a bunch if pixels from the top left corner of the screen all stretched out.
I tried using both the surface method as well as the sprite creation method. Both render the same results.
Here's my code just to be sure:
GML:
//oPause Step Event
if (keyboard_check_pressed(ord("P"))) {
paused *= -1;
if (paused == 1) && (initPause == true) {
audio_play_sound(sndTest,1,0);
pauseSurfW = surface_get_width(application_surface);
pauseSurfH = surface_get_height(application_surface);
pauseSurf = surface_create(pauseSurfW,pauseSurfH)
surface_copy(pauseSurf,0,0,application_surface);
instance_deactivate_all(true);
layer_set_visible("Foreground",0);
layer_set_visible("BgSprite",0);
initPause = false;
}
if (paused == -1) && (initPause == false) {
surface_free(pauseSurf);
instance_activate_all();
layer_set_visible("Foreground",1);
layer_set_visible("BgSprite",1);
initPause = true;
}
}
//oPause Draw Event
if (paused == 1) && (initPause == false) {
draw_surface(pauseSurf,0,0);
}
Some other info, as I assume it has to do with this:
room size: 270x100
view and viewport sizes: 160x90
game runs with fullscreen started.
Any idea what I'm doing wrong here?
Thanks!!!
Screenshot of paused screen:
Last edited: