This will be our controller object that will handle all kinds of tasks. We are going to set this up to follow a certain point, which will be the center of the view. Only seeing the top left corner of your screen isn’t exactly helpful in most cases, so let’s set this sucker up to move around. I can only see 1/4th of my entire room! Moving the view If you run the game, you should only see a small portion of your room in the game window. Otherwise it will be impossible to tell that we are moving the camera around. Whatever you have set for the "View in room" will be scaled to "Port on screen." I am using double my view size for the port size, which is half of my overall room size.Ĭheck out the screenshot below for all of my view settings for the room.īy the way, if you haven’t put any objects, or a background in your room, you should do that now. For my example, I am using 256 x 192, which is 1/4th of my overall room size.įinally, we come to "Port on screen." This section determines the size of the game window. If you wanted the entire room to be visible you would set the width and height to the width and height of the room itself. The set of variables under “View in room” determine the X and Y position of the view in the room when the game starts, and the width and height in pixels of the view. This will set the default view when your game runs to whatever the current view parameters are. Next, click the “Visible when room starts” checkbox. Should you want to enable more than one view, you would do so from here. You can ignore the list of views for now - we are only going to be working with a single view. There are a few important things we need to do here.Ĭlick the checkbox to “Enable the use of views." If you don’t do this, you won't be able to control a view at all since it will be disabled. Name the room whatever you’d like, and move on over to the views tab. My room used in this example is 1024 x 768. Before we can do anything, we need to enable views in our game.Ĭreate a room and make it any size. So, for example, if the wview doubles in size, the image on the screen will be scaled to be twice as wide. If these values are changed, the view is scaled along with it. wview is the width, and hview is the height.
The similarly named but completely different wview and hview variables refer to the size of the current view. The important thing to remember is that xview and yview always refer to the current position of your view in the room. If your view were to move 10 pixels to the right, and 10 pixels down, the coordinates would be 10 and 10 respectively. As soon as the room starts, these are usually zero and zero. These variables always contain the x and y coordinates of the top left corner of your view. Here are the key variables we are going to be using in this blog. Today, we are going to focus on a small part of views that should help you learn the rest on your own. Looking at the GameMaker documentation was confusing because all of the variables are so similar, and there was way more information than what I was looking for. I remember the first time I tried to set up a camera in GameMaker, I was so confused. How is view_xview different than view_wview and how are both of those different than view_xport and view_wport!? By the end of this blog, you should have a pretty solid grasp on the basics. Views, like most things in GameMaker, have some tricky to understand variables and functions. Howdy, partners! Welcome to another GameMaker basics tutorial! Today we are going to talk about views which is the camera system in GameMaker.