• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM Help with surface

L

Linda Cell

Guest
Hi, i'm making the game and testing on mobile, but i have the trouble with my game this is: when i runs it on windows platform, it works well and the FPS also is 60, the game runs smoothly but running it on mobile platform, the FPS is always dropped about 30-35. i checked everything, i think the cause is surface because when the night in my game, the FPS will go down. Thank for reading and helping. Here, this is my code:
Create:
Code:
// View/screen
screenW = view_wview;
screenH = view_hview;
surface_resize(application_surface,screenW,screenH);
display_set_gui_size(screenW,screenH);
Draw:
Code:
// Draw night overlay
conv_time = day_hour*60+day_min;
dark_time = 0*60;//0*60;
//night_alpha = 0.9-abs(angle_difference(conv_time*0.25,dark_time*0.25)/0.25)/(5*60);
night_alpha = 1.1-abs(angle_difference(conv_time*0.25,dark_time*0.25)/0.25)/(5*10);
if !surface_exists(surf) {
    surf = surface_create(view_wview,view_hview);
}
draw_set_alpha(1);
surface_set_target(surf);
draw_clear_alpha(nightCol,1);
draw_set_blend_mode(bm_subtract);
    

draw_set_blend_mode(bm_normal);
surface_reset_target();
draw_set_alpha(min(1,night_alpha*1));
draw_surface(surf,view_xview,view_yview);
draw_set_alpha(1);
}
}
 
Top