Legacy GM [Solved]Help pause background problem

L

lee

Guest
My game has some performance problem in old android, ios phone. (Galaxy 5 ok but galaxy4 has some lag)

So I used below function.
Code:
application_surface_enable(false);
Then it boosts fps significantly! But I used application_surface for making pause.
I got a error for no existence application_surface.
My code is like this
Code:
application_surface_enable(true);
var ret = -1;
var sfc_width = surface_get_width(application_surface);
var sfc_height = surface_get_height(application_surface);

// Create drawing surface
var sfc = surface_create(sfc_width,sfc_height);
surface_set_target(sfc);
// Clear screen;
draw_set_colour_write_enable(false,false,false,true);
draw_clear(c_black);
draw_rectangle_colour(0,0,sfc_width,sfc_height,c_black,c_black,c_black,c_black,false);

draw_set_colour_write_enable(true,true,true,false);
draw_surface(application_surface,0,0);
ret =background_create_from_surface(sfc,0,0,sfc_width,sfc_height,false,false);
surface_reset_target();
draw_set_colour_write_enable(true,true,true,true);
surface_free(sfc);
So I used for pause
Code:
screen_save_part("pauseBG.png",0,0,display_get_width(),display_get_height());
But it has a bug in android.(image is cropped) and slow.

Are there any way for making pause without using appliaction_surface or screen_save_part?
or is there any way make application_surface immediately?

I'm sorry for poor english.:)
 
Last edited by a moderator:

Xer0botXer0

Senpai
Pause with a boolean.

Code:
if bool_pause == true
{
//save state 
//pause everything lol
}
else
{
//load state
//carry on goin'!
}
 
L

lee

Guest
Pause with a boolean.

Code:
if bool_pause == true
{
//save state
//pause everything lol
}
else
{
//load state
//carry on goin'!
}
Thank you for reply. Sorry, my title was not clear.
I paused object with instance_deactivate_all(). Then make background . But I had a problem with make pause background..
application surface is slow in old phone. screen_save_part has a bug in android. Um.. Is there any way to make background without application_surface? or other method?
 
L

lee

Guest
oh you want to take a screenshot of the background ? without copying from application_surface ?
Yes. I made background screenshot with application_surface before. But using application_surface slow in old android phone.
So I disable application_surface with 'application_surface_enable(false);'. It boosts fps well.
But it causes a problem when make background screenshot with application_surface. So I found another method with screen_save_part() but it has bug... So I need to find some another way.
 

RangerX

Member
I do it with The Life Ruby.

1- turn on application surface
2- use surface create from surface
3- turn off application surface

voila!


EDIT: its possible you need to let the game have another step in order to draw everything on the application surface but that should be perceptible for the player
 
L

lee

Guest
I do it with The Life Ruby.

1- turn on application surface
2- use surface create from surface
3- turn off application surface

voila!


EDIT: its possible you need to let the game have another step in order to draw everything on the application surface but that should be perceptible for the player
I change my all pause logic(it takes some time) and it works perfectly!
I'm not sure but some slow android phone needs 2 step for application_space.
I hope so gms support more easy way to capture screen.
Thank you for help!
 
Top