- Home /
make the camera always match the resolution
Am working on a android 2D game and I want my camera to fit all resolutions without cutting any parts of the screen . So my question is : is there a relation (like an equation)between : camera.size, Screen.width , Screen.height, aspect ratio, that will allow me to achieve my goal perfectly ? And thanks.
Answer by hexagonius · Jun 29, 2017 at 08:59 AM
That's not possible. Check out the following picture. For this to be possible any of the screen rectangles have to somehow match all the other by just uniformly scaling them up or down. But as you can see they're of different aspects:
so what's the appropriate way of handling resolutions sir ? Am really confused at the moment . Since this is my first 2D game on unity., should I just give up on the lost parts of screen ?, or make specific algorithms for certain resolutions ?
You either scale the game to fit, or you define a playable area, that adds and subtracts to and from the sides and top/ bottom additional content to accommodate for that. Since you're going 2D you could basically do this in Photoshop and build it in unity like that.
Your answer
Follow this Question
Related Questions
2d camera movement 1 Answer
Isometric - Camera follow an object when at the edge of the screen 1 Answer
Creating a 2D game on the X-Z plane, any adverse effects or challenges with this? 3 Answers
2D camera rotating relatively to game object speed 0 Answers
camera follow problem-unity 4.3 2d 1 Answer