To enable fullscreen in GameMaker, you can use the built-in GameMaker Language (GML) function
window_set_fullscreen(). This allows you to toggle between fullscreen and windowed mode. Here's how you can use this function:
To set your game to start in fullscreen by default, place the fullscreen function in the
Create event of an object that is initialized at the start of your game, such as a controller or game manager object.
Additionally, if you want to provide players with the option to toggle fullscreen on and off, you could tie this function to a key press or an in-game menu option:
This checks for a key press and toggles the display mode accordingly. The
window_get_fullscreen() function returns whether the window is currently in fullscreen mode (
true) or not (
Be aware that changing the display mode might affect the appearance of your game depending on how you've handled scaling and aspect ratios. Make sure you have systems in place to handle these changes to ensure that switching modes provides a seamless user experience.
Using these functions appropriately will allow you to control the fullscreen state of your GameMaker project.