M
Magic-4e
Guest
Hi there I am making a pause screen for my game and I stumbled across a problem.
When I pause the game only a quarter of the screen is visible.
I mean that objects are only visible on a quarter of the screen.
I am using a disabled command to stop all objects from moving so they don't desync or lose velocity.
And I am using a surface comand to make the objects appear again while everything is standing still.
Here is my code:
PAUSE ACTIVATION CODE:
global.pauseSurf = surface_create(view_wview[0], view_hview[0]);
surface_set_target(global.pauseSurf);
with(all)
{
if (visible == true)
{
x = x-view_xview[0];
y = y-view_yview[0];
event_perform(ev_draw, 0);
x = x+view_xview[0];
y = y+view_yview[0];
}
}
surface_reset_target();
instance_deactivate_all(true);
instance_activate_object(Pauze_obj);
PAUSE DEACTIVATION CODE:
instance_activate_all();
if (surface_exists(global.pauseSurf))
{
surface_free(global.pauseSurf);
}
DRAW EVENT CODE:
if (global.Gamepauzed == 1)
{
draw_set_color(c_black);
draw_set_alpha(0.5);
draw_rectangle(0,0,room_width,room_height,0);
draw_set_alpha(1);
if (surface_exists(global.pauseSurf))
{
draw_surface(global.pauseSurf, view_xview[0], view_yview[0]);
}
}
*If you guys need more info on my game just let me know.*
.
When I pause the game only a quarter of the screen is visible.
I mean that objects are only visible on a quarter of the screen.
I am using a disabled command to stop all objects from moving so they don't desync or lose velocity.
And I am using a surface comand to make the objects appear again while everything is standing still.
Here is my code:
PAUSE ACTIVATION CODE:
global.pauseSurf = surface_create(view_wview[0], view_hview[0]);
surface_set_target(global.pauseSurf);
with(all)
{
if (visible == true)
{
x = x-view_xview[0];
y = y-view_yview[0];
event_perform(ev_draw, 0);
x = x+view_xview[0];
y = y+view_yview[0];
}
}
surface_reset_target();
instance_deactivate_all(true);
instance_activate_object(Pauze_obj);
PAUSE DEACTIVATION CODE:
instance_activate_all();
if (surface_exists(global.pauseSurf))
{
surface_free(global.pauseSurf);
}
DRAW EVENT CODE:
if (global.Gamepauzed == 1)
{
draw_set_color(c_black);
draw_set_alpha(0.5);
draw_rectangle(0,0,room_width,room_height,0);
draw_set_alpha(1);
if (surface_exists(global.pauseSurf))
{
draw_surface(global.pauseSurf, view_xview[0], view_yview[0]);
}
}
*If you guys need more info on my game just let me know.*
.