Game Maker in fullscreen: resolution change

As many people know, in Global Game Settings we can activate the F4 key, which allows the user to change the screen mode. However, if the screen resolution is different from the game one, in fullscreen mode the image degrades.

Therefore I post this solution that solves the problem and that I used in many games. It’s based on a persistent object Screen. When the user presses the F4 key, the software asks him if he wants to change the screen resolution. The object takes care also to hide the mouse pointer (in case it is visible) when you switch to fullscreen, and make it reappear when you go back to windowed mode; it also solves the window placement problem (information that is lost when you change resolution). Also information about scaling is saved and restored.

Just create a persistent object Screen with the following code. We specify the fullscreen resolution with two constants: DISP_W and DISP_H. That’s all.