GMS 2 Creating surfaces on step

Hello there!,
I have a pause system where I copy the application surface whenever the player presses the pause button; I've read that surfaces should not be created outside the draw event; how could I possible achieve this with the creation of my paused surface in the draw event?

I though of applying the conditional in the draw event and then checking if the surface exists in the step event and, if so, copy the surface, etc., but I don't think that way is the optimal one...

Thank you!


Forum Staff
The manual page about Surfaces offers some insight into technical why and how.

It all boils down to "keep surface-related code in the Draw event". You could check for key presses in the Step event and flip a boolean to indicate the game is paused, which takes care of the logical portion, then check that variable in the Draw event to copy the surface (if it has not been copied already or does not exist) and draw it back to the screen, which takes care of the graphical portion.