I am creating a game for multiple devices with different aspect ratios/screen sizes. How can I allow player to change the aspect ratio? Will this aspect ratio be saved even if player exits my game?
I found many tutorials about multiple screen sizing, but none of them helps me much. My game has a fixed layout size and I don't want black bars to appear down the sides of the window, so I thought that the best way to fix a problem with aspect ratios is to allow a player to choose it.
i'm replying because I would also like to know the answer as I had the same issue
Develop games in your browser. Powerful, performant & highly capable.
Good question. I'm not sure it's possible ... But I don't get it exactly, because logically you can't adapt your "fixed size" layout on different resolutions without croping or having bars. (isn't it like "I want to display a triangle layout on a circle screen without cropping and bars" ?)
Or are you planning to create different layouts with different sizes for the various screens ? In that case, you can duplicate the game layout, change its size, and make an event at start that compare the screen size, then GoTo to the layout made for it .... Not really sure if it's a good idea, though, because it can be a pain in the ass to debug if you got duplicated layouts.
I guess best practices are those mentionned in this tutorial : https://www.scirra.com/tutorials/73/sup ... reen-sizes
Maybe you can plan wider "decorated" margins of your layout, not made for playing but just to avoid black bars on wider screens.
https://drive.google.com/open?id=0B-xiq ... 0lDRklrNVU