Legacy GM Draw GUI & Fullscreen Mode

B

Ben Hubble

Guest
Capture.PNG Screenshot.png The first picture is in windowed mode, second is in fullscreen mode.
Hello! So i have an option menu in my game, in which i can change the resolution, fullscreen, vsync and anti-aliasing settings in-game. I use this code to change the resolutions:
Code:
globalvar width, height;
            width = get_integer("Keep The Aspect Ratio At 3:4 For Windowed Mode, 16:9 For Fullscreen Mode",640);
            height = get_integer("Keep The Aspect Ratio At 3:4 For Windowed Mode, 16:9 For Fullscreen Mode",480);
            window_set_size(width,height);
            display_set_gui_size(width,height);
            surface_resize(application_surface,width,height);
But I think there is a problem with the way I scale my gui. I think this because when i go into fullscreen mode, the text that is written in the Draw GUI event become a lot smaller than it is in windowed mode.
Can anyone tell me if this is normal and I just have OCD or is there something wrong with this?
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
If you want the gui to maintain a fixed pixel ratio when you go to fullscreen you need to set the width or height to a fixed amount and then only scale the other appropriately. For example, if you want a fixed GUI height of 480 you'd have something like:

Code:
var r = display_get_width() / display_get_height();
display_set_gui_size(480 * r, 480);
That will maintain the same height and adjust the width to fit the aspect ratio.
 

Yal

šŸ§ *penguin noises*
GMC Elder
I think this because when i go into fullscreen mode, the text that is written in the Draw GUI event become a lot smaller than it is in windowed mode.
Set the GUI size to the same size as the game is in windowed mode. If you set it to the same size as the fullscreen'd window, you don't actually scale it up... you tell it to use the whole window but in the same scale.
 
B

Ben Hubble

Guest
Ignore what this post said before, it works great now. Thanks for the help
 
Last edited by a moderator:
Top