Paskaler
Member
So, I tried making a pause function within the game. All the objects get deactivated except the obj_pause itself and obj_environment which takes care of the background scrolling. Right before I deactivate everything I make a copy of application_surface using:
Below are two images, taken at the same location:
Before pausing:
After pausing:
Here's the entire code of the event where the surface is copied:
Code:
surface_copy(self.screen, 0, 0, application_surface)
Before pausing:
After pausing:
Here's the entire code of the event where the surface is copied:
Code:
self.isPaused = !self.isPaused;
if (self.isPaused)
{
if (!surface_exists(self.screen))
self.screen = surface_create(surface_get_width(application_surface), surface_get_height(application_surface));
surface_copy(self.screen, 0, 0, application_surface);
instance_deactivate_all(true);
instance_activate_object(obj_environment);
instance_activate_object(obj_camera);
}
else
{
instance_activate_all();
self.manual = false;
if (surface_exists(self.screen))
surface_free(self.screen);
}