S
Sam (Deleted User)
Guest
Hey guys.
With the following code, in the "Draw GUI" event, of a persistent, top-most object, created in the first room of your game, you can make your game contents stay the same resolution on your screen, regardless of whether the game is in fullscreen, and regardless of the window's size. Be sure to have "Full Scale" as your scaling type, under Global Game Settings (GMS1.4) / Options (GMS2.X):
You may also need to do this in the create event, if the window is to be resizeable:
My question is that, is it possible to do this, or something similar, using some other method, without the application_surface enabled? I need the application_surface disabled for a game I need better performance on, (Android / OUYA game). Like first example that comes to mind is I could make a surface from the screen every step and then draw it stretched to the specified coordinates, but 1) I don't know how to do that and 2) it seems like that would run even slower. I need a way to do this that works in both GMS1.4 and GMS2.X...
Any help or suggestions are greatly appreciated.
Samuel
With the following code, in the "Draw GUI" event, of a persistent, top-most object, created in the first room of your game, you can make your game contents stay the same resolution on your screen, regardless of whether the game is in fullscreen, and regardless of the window's size. Be sure to have "Full Scale" as your scaling type, under Global Game Settings (GMS1.4) / Options (GMS2.X):
Code:
var game_width, game_height;
game_width = 960; // example width ...
game_height = 540; // example height ...
display_set_gui_size(window_get_width(),window_get_height());
draw_set_color(c_black);
draw_rectangle(0,0,window_get_width(),window_get_height(),0);
draw_set_color(c_white);
draw_surface_stretched(application_surface,(window_get_width()/2)-(game_width/2),
(window_get_height()/2)-(game_height/2),game_width,game_height);
Code:
var game_width, game_height;
game_width = 960; // example width ...
game_height = 540; // example height ...
window_set_min_width(game_width);
window_set_min_height(game_height);
Any help or suggestions are greatly appreciated.
Samuel