• 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!

Room Scaling Help

M

MrTheRat

Guest
Forgive me if this has previously been addressed somewhere. I've spent over an hour trying to find a solution and because my problem still exists I'm asking for help here. I've toyed with the older Game Maker and now Game Maker Studio on Steam off and on within the past few years and I've never encountered this problem until I began production in Studio. If you can help, please keep it simple or well-explained since I'm not very good at using this tool.

Basically I have an introduction room to my game with a width of 368 and a height of 704 and when the user activates the play button the room is supposed to transition to the next, which has a width of 640 and a height of 480. As I understand it, the window originally would automatically shape the size of your room but it didn't in this case. I proceeded to put in this code: window_set_size(640,480) which seemed to be what I wanted. For a brief second the room fits that new window, but then it seems to instantly deflate back to the old dimensions in a squished and unintended way, much like it looked before I adjusted the window except with thick black bars on the side made from the window I expanded.

I feel like this has an easy fix. Hope I can get some help. Thanks.
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Do you have views active? The window size will be set to that of the view PORT of they are, and if you don't have a view set then the window will default to the size of the CURRENT room. So either set the view port to be the size you want as well as call window_set_size OR set the window size at the start of the room and not before in the previous room.
 
M

MrTheRat

Guest
Even when I set the window size at the start of the room I want, it shapes properly momentarily then reverts back to what appears to be the dimensions of the title screen before it. The same thing happens when I set the window size in the previous room and have view port on what I want as well. In both cases the playable area is flattened to fit the title screen instead of the value of the new window, room size, or view port.
 
Last edited by a moderator:

jo-thijs

Member
@MrTheRat, Hi and welcome to the GMC!

To solve this issue, you also have to resize the application surface.
Use this code in the new room and you should be golden (on windows target at least):
Code:
window_set_size(room_width, room_height);
surface_resize(application_surface, room_width, room_height);
PS: Change room_width, room_height to view_wport, view_hport if you're using view(s).
 
Top