![]() The first thing we are going to do is tick the Enable Viewports and the Clear Viewport Background options. With the room editor open, you need to go to the Room Properties window, shown below, and expand the Viewports and Cameras section: Open the Room Editor now on the resource rGrass (simply double click on the resource, or use the right click menu and select "open"). This is far from satisfactory, and so we are going to set up a camera view in the Room Editor and limit what the player sees to only what is visible to the camera. The whole room is shown, but it's been scaled to fit the view port, which in turn may have been scaled to fit the screen. When you have run the default Demo project for this tutorial, you can see what happens when we leave it up to GameMaker Studio 2 to set up the default camera. This means that if you do not actively use cameras and views, you should make all your game rooms the same size If you then change rooms to one that is a different size - 1024x768, for example - then the game window and view port will still be 800x400 but the camera view will be 1024x768 (to see the whole room) and then scaled/stretched to fit the smaller view port. So if your first room is, for example, 800x400, then GameMaker Studio 2 will create a view port that is 800x400 and a camera with a view that covers the whole room. If you do not create your own camera view and view port, GameMaker Studio 2 will still create a "default" camera and view/viewport based on the dimensions of the first room of the game. Note that this is true even if you don't have views activated in the room settings. So, when you run a game in GameMaker Studio 2, you will have at least one camera, and it will draw what it sees (the view) to a view port, which is then shown in the game window to the player. You have a scene that you want to film (the GameMaker Studio 2 room where your game happens), you have a camera to film it with (the GameMaker Studio 2 camera obviously), you have a lens that captures what you see (the GameMaker Studio 2 view) and you have a screen that displays what you see (the GameMaker Studio 2 view port). The most obvious analogy to understand what is going on is to use that of an actual video camera. The View Port: The area of the physical screen where the camera view will be displayed.The View: This is what the camera sees, based on the position, projection and rotation of the camera.The Camera: This is essentially a "container" that will be used to hold the different view values and set how the room is displayed on screen.When you create your game, what the player "sees" at any given moment is governed by three different - but connected - things: ![]() This can all be easily achieved in GameMaker Studio 2 using cameras and view ports, and in this tutorial we'll take you through all the basics of setting up and manipulating custom cameras in your own projects. with the main character) while another part is fixed (for example some status panel). A further example is in games in which part of the room should scroll (e.g. Cameras can also be used in multi-player co-op games, as they permit you to create a split-screen setup in which in one part of the screen you see one player and in another part you see the other player. For example, in most platform games, the camera follows the main character, since if you could see the whole level on the screen then your character would be too small to see and there would be no surprises for the player. Cameras give a mechanism for drawing different parts of your room to different places on the screen, or for drawing just a single part of your room to cover the whole screen.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |