S
Sanctifier
Guest
Hi Everyone.
I have an issue with my surfaces when I minimize my game. When I restore it again, a copy of all my drawings and instances gets 'baked' onto the screen. This doesn't occur straight away, but when I draw something to the targeted surface. Also it seems to draw these objects at their last position before minimization.
Here's my code.
- Draw Event of obj_Surface_Controller
And Here's an example of me drawing something to the surface.
- Draw Event of obj_Casings
I'm struggling to find a solution, particularly since I don't know of any way to check for a minimized screen.
I have an issue with my surfaces when I minimize my game. When I restore it again, a copy of all my drawings and instances gets 'baked' onto the screen. This doesn't occur straight away, but when I draw something to the targeted surface. Also it seems to draw these objects at their last position before minimization.
Here's my code.
- Draw Event of obj_Surface_Controller
Code:
if (obj_Controller.endGame == true)
{
surface_set_target(surf);
draw_clear_alpha(0, 0);
surface_reset_target();
}
//Draw surface
if (!surface_exists(surf))
{
surf = surface_create(room_width, room_height);
}
//Create a new surface if DX destroys the old surface due to resizing
else
{
draw_surface(surf, 0, 0);
}
- Draw Event of obj_Casings
Code:
draw_self();
if (moveSpd <= 0)
{
if (instance_exists(obj_Surface_Controller))
{
surface_set_target(obj_Surface_Controller.surf);
draw_sprite_ext(spr_Casings, image_index, x, y, image_xscale, image_yscale, image_angle, c_white, image_alpha);
surface_reset_target();
}
}
I'm struggling to find a solution, particularly since I don't know of any way to check for a minimized screen.