Posted by Mike Dailly on 10 June 2012
So as of GameMaker:Studio version 1.0.233 there is a brand new drawing event, dedicated to rendering on screen displays, scores, health, overlays, user interfaces and the like. GameMaker has needed this for some time, particually if your using scaled or moving views as you would have to constantly "offset" the rendering to counteract the current room view.
So what does this do? Well the image above shows this event in action. First we have a room with a view that scales eveything down and scrolls to the right, and then we have a GUI over the top. Now normally, you would not only have to offset the rendering by the distance into the room, but unscale the rendering as well.
This is not only horrible, but can introduce some movement in the HUD as unscaling things scaling can cause floating point rounding errors.
The new event however solves all these problems.
Just like the DRAW event, everything using the new GUI event is ordered by depth, allowing you to draw multiple sections to the GUI in the correct order. But the best thing about the GUI event, is that rendering is always setup to draw 1:1 to the width and height of the screen.
This means you no longer have to offset the drawing to where the view in the room is, nor do you have to unscale it if you were shrinking the view. It will also render over the top of any views, as it's outside of the view system.
Unlike the drawing event, nothign will "automatically" be drawn to the GUI layer, so if you want to draw anything, will have to add some script or some D&D actions, but aside from that... it's going to make on screen displays much easier to deal with.
So finally, making a GUI in GameMaker is simple, regardless of the views you use, or the position in the world you are.