

Surface_copy(sur_oldroom,0,0,application_surface) Sur_oldroom = surface_create(room_width,room_height) copy the old room so we can display it on the second room Persistent = true // when changing room keep this object alive We will do this with a sliding transition: In this article I will show you how to capture images of the current state of the screen and the basic method we will be using to trigger the transition and keep track of how far along the transition is. If you haven’t used surfaces before they are basically an empty canvas you can draw onto in the same way you draw any sprite onto the screen and anything you draw there is saved, these surfaces can then themselves be drawn onto the screen with everything you have added onto them. You can even use it to have a preview of how the other two transitions will work. This seems like a good place to say that I will be providing a GameMaker project file so you can see it working in full if you download that and you can grab any code you need or make changes and have a tinker. However this is just an illusion and is actually just many images that have been put together to look like this. Not only does that final transition look like you can see two rooms at the same time, but the second room looks like it has been broken up and brought on in chunks and put back together. Let’s look at the three transitions we are going to make :

Now I’m sure you are already thinking “there are loads of guides for doing screen transition what are so special about these ones?” Well these screen transitions look like you can see two rooms at the same time. In this article we will learn how to do the first transition and there will be a follow up article showing you how to make the other two transitions. We will be learning how to do 3 room transitions starting off easy and each one just getting a tiny bit more complex.

For the last few months I have been obsessing over using surfaces and how they can be used to do masking, lighting, outlines, shadows, and countless other powerful graphical features. So in this post I’m going to showcase surfaces in GameMaker as it is one of the many features I feel doesn’t get the attention it should. When Shaun Spalding approached me to write a guest blog article I knew I wanted to do something at an intermediate level to help those who have got the basics down and understand how GML works.
