• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

SOLVED [1.4] Best Way to Accomplish Viewport Smaller Than Screen/Window?

I'm relatively new to GM, having done some tutorials and general fiddling a few years back, and I recently dusted off my copy of 1.4 and have been investigating using it for a retro point-and-click project that I'm working on.

I was hoping to have the game take place in a constricted viewport only covering part of the screen, with the GUI borders, controls, a text box, etc. covering the rest.

Initially, I set my room size to the size of what the viewport is supposed to be, drew the GUI background using the Draw GUI event, and attempted to draw a viewport in the transparent cutout in the GUI using its coordinates and size. I was quite confused when instead of the viewport being drawn at the location and size I wanted, it was taking up the whole window no matter what I did.

After some poking around I came across some forum threads that suggested that this was the result of GM fitting the application surface to the viewport, which is then stretched to fit the window? From my limited understanding I believe the solution was to disable automatic drawing of the surface and instead to handle it manually. I'm not sure if that will cause headaches down the road.

The other option I came across was to set the room size to the screen size instead of using a viewport, and pad the game art to fit where the GUI image cutout would be. This seems like it might be a bit kludgy, requiring additional work to set up each room, etc.

Are those my only two options? Is there a better way I'm unaware of, or a more elegant way to accomplish one of those two? (For all I know, this is something that's been totally overhauled in GM:S 2. I've just been hoping to use 1.4 until I am at least confident I'm going to have a viable project going so I can justify the expense.)

Thanks in advance for any help!
 
I think I've solved my own problem, after further digging: It seems that if you define View 0 for the room in empty space at the size of the full window, and then View 1 as the partial screen viewport you were wanting, it solves the problem relatively elegantly.
 
Hi, thanks the explanation to your own question :)

I hope it's ok for me to ask about the solution. When you write "View 0 for the room in empty space" what does empty space mean? I tried using both view 0 and view 1, but I get the "game world" in both views - fullscreen for view 0 and partial screen for view 1. View 1 is overlayed on view 0. Thus, I can see both at the same time. I would view 0 to show nothing :)

Any advice?
Thanks!
 
Are you using 1.4 like I am? I think with 2 you can set the size of the camera to nothing and so nothing will display in the view, but what I did in 1.4 is set the coordinates for View 0 to an empty place in the room where there there aren't any objects or tiles or anything. If you have a background image or background color set that might be a problem though as View 0 will end up showing the background. In my case, I have a big GUI background image with a transparent "porthole" that I'm using to cover up everything that isn't View 1. Does any of that help?
 
Last edited:
Top