GameMaker Supporting Custom Resolution and Aspect Ratio

D

DarthTenebris

Guest
Hello everyone,

I am trying to make a multiplatform game, but it just occured to me that Android phones are no longer simply rotated desktop screens. Various resolutions and aspect ratio exist outside of the standard 16:9 desktop. Are there any tutorials that teach how to support all these weird shapes and sizes? I would like my game to look good on regardless of the shape and size of the device it is run on.

Thank you for your time.
 

NightFrost

Member
This can depend a bit on the type of game you're doing. For example let's say you're building a Tetris clone. In this, the view is your entire game room the camera won't move. The room has been built to a certain size and aspect ratio. The simplest thing to do here is to maintain that aspect and simply add black bars at sides when user's display doesn't conform. A more complex approach is to resize view and room aspects, move UI elements so the game appears to fill the entire screen, though in practise you're just adding empty space into it. The latter may not be worth the hassle unless you really really want to avoid displaying any black borders.

On the other hand you might be creating a top-down RPG style of game where the view is only a small portion of the game room. You might shape the view to conform with display aspect so it nicely fits into the screen. On the other hand you might want every player on every platform have the same sized view into the world, in which case you don't alter view aspect and just add black borders.
 

Petrik33

Member
I am having troubles with the same thing now, but still what basicly everyone is usually suggesting for such problem is this:
But it's only the first part out of four, and the the actual coding will only start from the third, and also the code is for GMS 1 so it can also be hard to apply it to the newer version. But actually I thing I have done it quite successfully because I have achieved the effect that I needed, the pixel perfect image on any screen (by cropping or expanding view + limiting it) but my code is unapplyable because I have finished with the problems with GUI, but if I fix it I guess it will be quite clean then and I can share it with you. Still better watch this little tutorial series
 
D

DarthTenebris

Guest
This can depend a bit on the type of game you're doing. For example let's say you're building a Tetris clone. In this, the view is your entire game room the camera won't move. The room has been built to a certain size and aspect ratio. The simplest thing to do here is to maintain that aspect and simply add black bars at sides when user's display doesn't conform. A more complex approach is to resize view and room aspects, move UI elements so the game appears to fill the entire screen, though in practise you're just adding empty space into it. The latter may not be worth the hassle unless you really really want to avoid displaying any black borders.

On the other hand you might be creating a top-down RPG style of game where the view is only a small portion of the game room. You might shape the view to conform with display aspect so it nicely fits into the screen. On the other hand you might want every player on every platform have the same sized view into the world, in which case you don't alter view aspect and just add black borders.
I don't mind the player seeing more or less depending on their screen aspect ratio, I just want it filled completely and with no borders. Also looking to implement zooming in and out by either scrolling the mouse or by pinching on a touch device.

I am having troubles with the same thing now, but still what basicly everyone is usually suggesting for such problem is this:
But it's only the first part out of four, and the the actual coding will only start from the third, and also the code is for GMS 1 so it can also be hard to apply it to the newer version. But actually I thing I have done it quite successfully because I have achieved the effect that I needed, the pixel perfect image on any screen (by cropping or expanding view + limiting it) but my code is unapplyable because I have finished with the problems with GUI, but if I fix it I guess it will be quite clean then and I can share it with you. Still better watch this little tutorial series
I've seen that video, but thanks anyway. I'll rewatch it, perhaps it'll help me.

Thank you for your time.
 
Top