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

Legacy GM Screen Sizing on mobiles

R

Richard Mountain

Guest
What's the best way to enable your game to fit full screen across as many mobile devices as possible?

Do you have to create assets for all of the different aspect ratios or can you scale them accordingly?

Is there a best practice for this?
 
best practise is to only scale the height or width, not both

Code:
display_ratio = window_get_width() / window_get_height();

view_hview = room_height;

view_wview = display_ratio * room_height;
mind you i only provided the code to scale it no matter what machine it is on, you need to make use use of "if os_type = os_windows" and give the height and width its own designation when you are testing on a pc otherwise this will try to scale to the entire screen and on a portrait mobile game will result in very heavy distortion.

otherwise this should be enough (presuming you are not running through a room and the entire level can be seen on one screen) to orientate for rooms on most mobile devices.

good luck.
 
D

Daz@mbi

Guest
What JML said is pretty much what I do.
Also I find it easier to make the game with the smallest aspect ratio so you know everything fits,
 

jazzzar

Member
best practise is to only scale the height or width, not both

Code:
display_ratio = window_get_width() / window_get_height();

view_hview = room_height;

view_wview = display_ratio * room_height;
mind you i only provided the code to scale it no matter what machine it is on, you need to make use use of "if os_type = os_windows" and give the height and width its own designation when you are testing on a pc otherwise this will try to scale to the entire screen and on a portrait mobile game will result in very heavy distortion.

otherwise this should be enough (presuming you are not running through a room and the entire level can be seen on one screen) to orientate for rooms on most mobile devices.

good luck.
but what if i don't use views, i really need help scaling for different screens is a big problem for me and is preventing me from working on the game :(
 

RangerX

Member
Your first problem is to not use views. Use them.
Am curious about a couple of things too. Is your game pixel graphics? vector graphics? 3D?
Because this changes the scaling strategy.
You also want to look over the internet for what are the screen resolutions of the most popular phones. This is how your game will look good on many devices, you need to know who you're scaling for.

Also, while treating specifically of Android or IOS module, my tutorial on scaling can help you understand how you should proceed (also see the linked YoyoBlog posts).
https://forum.yoyogames.com/index.php?threads/how-to-properly-scale-your-game.995/
 
Top