GML Constant for Room Scaling?

T

TheTrophieStars

Guest
I'm trying to create a little text box engine but I've run into a problem. When the game gets resized, everything remains small, and the gui is off centered. How can I scale everything so the game appears precisely as I want it to for any screen size. There must be a setting to make everything scale and appear appropriately?
 

Gillen82

Member
Create an object and within the Create Event, add the following:

Code:
fullscreen = false;
screen_width = display_get_width();
screen_height = display_get_height();
Within the Step Event, add the following:

Code:
if(keyboard_check_pressed(vk_f4)){

    if(!fullscreen){
        fullscreen = true;
        window_set_fullscreen(true);
        display_set_gui_size(screen_width, screen_height);
        surface_resize(application_surface, screen_width, screen_height);
    } else{
        fullscreen = false;
        window_set_fullscreen(false);
        display_set_gui_size(screen_width, screen_height);
        surface_resize(application_surface, screen_width, screen_height);
    }
       
}
Make the object persistent and add it to your room

You can replace the vk_f4 with whatever key you want.

Hope this helps, or at least points you in the right direction
 
T

TheTrophieStars

Guest
Create an object and within the Create Event, add the following:

Code:
fullscreen = false;
screen_width = display_get_width();
screen_height = display_get_height();
Within the Step Event, add the following:

Code:
if(keyboard_check_pressed(vk_f4)){

    if(!fullscreen){
        fullscreen = true;
        window_set_fullscreen(true);
        display_set_gui_size(screen_width, screen_height);
        surface_resize(application_surface, screen_width, screen_height);
    } else{
        fullscreen = false;
        window_set_fullscreen(false);
        display_set_gui_size(screen_width, screen_height);
        surface_resize(application_surface, screen_width, screen_height);
    }
      
}
Make the object persistent and add it to your room

You can replace the vk_f4 with whatever key you want.

Hope this helps, or at least points you in the right direction

Thanks, how would I handle full Windowed? Or just resizing? Does the same idea apply?
 
Top