- Home /
Game Resolution and Scaling Unity 2D
I'm currently testing Unity to use it as the engine for my next game. It's a 2D platform that will run on PC.
I'm really concern about multi resolution because it's been an issue before, and some other solutions like Cocos2d-x and XNA have really straightforward approaches to this.
I want the game to have the 16:9 aspect with default resolution being 1920x1080. I also want to keep the aspect, but make it possible to select different resolutions. It's not a problem if the game will have black bars on top and bottom of the screen when running in different aspects.
I've seen some topics about this for mobile games in Unity. I haven't seen many topics about my issue in particular (Is anybody else doing 2D PC games on Unity?).
I'm using ortographic camera, and so far I've been able to get the camera size 5.4 using the formula:
cameraSize = 1080 / 100.0f / 2.0f;
100.0f being the units per pixel value.
Can somebody give me some advice on how to get this to work? This is a really important issue and if I don't get it right, maybe I'll have to find another engine.
Thanks for your help!
Answer by tanoshimi · Dec 22, 2014 at 07:05 PM
Go Edit -> Project Settings -> Player. Under "Standalone Player Options", check 16:9 Supported Aspect Ratio, and uncheck all others. Then players will only be given option of supported 16:9 resolutions when starting the game.
I don't want to use that window either. I want to give the options inside the game through an options menu.
I've done this before in XNA and it was not that hard.
Please don't post additional information or comments as "answers". Edit your question, or add a comment.
Perhaps you're looking for http://wiki.unity3d.com/index.php?title=AspectRatioEnforcer ?
Your answer
Follow this Question
Related Questions
put prefab in top left of the camera 0 Answers
Multiple orthographic cameras issue 2 Answers
ScreenToWorldPoint for different ortographic size 1 Answer
Camera orthographic size not changing 0 Answers
SmoothDamp bounce effect 0 Answers