GameMaker How to do camera smaller than game window?

breakmt

Member
I want my game window to be something like this (please, look at screenshot) - small green area with map (Room) and other gray area is UI.
Is it possible to do with GM?

I tried to do this but failed for now. I did following:
1. Room0 with size 960x540 (and script with goto Room1),
2. Room1 with size 240x45 and camera 240x45 + viewport 960x180

Result: window is 960x540 BUT camera is stretched to this window, not 960x180...

Any ideas? Thank you!
 

Attachments

Rob

Member
You want to set up 2 views for this. You might need to check what's being drawn in each view though.

Just for clarification - you'll have one room, split into 2 views, 1 for the "game room" and the other for UI.
 
N

NeZvers

Guest
For prototype ok, but generally try to stay away from hard-coded resolution, not everyone have same resolution displays (not talking about mobiles).
 

TheouAegis

Member
Draw the application_surface in the GUI event. You'd have to mess around a bit with it I think, because I couldn't get it to draw the application_surface at the right size by initially, which I didn't really care about anyway.
 

breakmt

Member
You want to set up 2 views for this. You might need to check what's being drawn in each view though.

Just for clarification - you'll have one room, split into 2 views, 1 for the "game room" and the other for UI.
Hey, Rob!
I did as you suggested - I defined 2 viewports in room. First one is for window size, second one is for game room. It seems to be ok, but I have one more question. Is it ok, that in first viewport I set Camera coordiantes to 0,0,0,0? Is it normal way to say to GM that I don't want him to show room in this view? :)
 
Just wanted to say thank you for this. After digging through more complex solutions to this problem, the two views one seems to be the easiest and one of the most elegant. I'm still using 1.4 for the time being, but it works to position the view in empty space instead of setting the camera width and height to 0.
 
Top