
For example, you could have an option that allows the user to turn off surfaces. Provide alternatives in your game for users that run into such errors, and cannot play the game. Warn people of the system specs required to run the game, orĢ. When coding Surfaces into your game it is suggested that you either:ġ. Some give awful background effects when transparency is supposed to be drawn, and others simply refuse to even create the surfaces.
Surfaces will not be saved when saving a game.Ĭertain video cards will not display surfaces properly. the screen resolution changes or the screensaver pops up. As a result, you might lose the surface when e.g. For reasons of speed, the surface is maintained in videomemory only. You can use them while not in 3D mode (by calling d3d_end() before using them, but once you start 3D mode again the surfaces will be destroyed. Surfaces do not work correctly with 3D mode. This will cause serious problems with the projection and viewport. You should never change the drawing target while you are actually drawing on the screen, that is, never use it in drawing events. Custom Surfaces can be a size of your choosing, and are not restricted to the room size.Īlso, it is very important to note the following things about surfaces:. The Screen surface's size is room_width x room_height. This is also why things drawn in a step event will not show up, because the screen is cleared at the end of the step, and all your objects' draw events are called. This is how we get the illusion of moving objects, because they are constantly being cleared and drawn in a new position, and appear to be moving across the screen. The Screen is cleared every step of the game. The Screen is the default Surface that draw_ functions are painted on. So, now we know this - we can draw things onto a Surface just like we draw things onto the screen! Here are the main things you need to know about drawing on a Surface vs. In the next section, I will show you how to make them visible.
Why? Because Game Maker is told to only show one Surface, the Screen. The key difference is that your own Surfaces will be invisible, and not displayed.
Meaning instead of drawing the information onto the screen, you can choose to draw it on a specific surface other than the screen. So now, what do these fancy Surface things do?Ī Surface is just a different canvas. So when I told draw_sprite to draw the character at position (0, 0), I am actually telling Game Maker to draw the character at that position on the screen canvas. Just like the Manual explains a Surface as a canvas, the screen is also a canvas! But what exactly is this draw_sprite function doing? The function takes the bitmap information from sprBald and copies it onto the screen, which is the visible canvas on which all your game's visuals are shown.