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.

2 Answers

2

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:

https://www.google.de/search?biw=360&bih=310&tbm=isch&sa=1&ei=msBUWbvXFsaN0gWKlYiIBQ&q=mobile+screen+sizes&oq=mobile+screen+si&gs_l=mobile-gws-img.1.1.0l5.3146.10597.0.11600.22.18.2.1.1.0.557.4606.0j9j3j3j2j1.18.0....0...1.1j4.64.mobile-gws-img..2.20.4171.3..41j0i67k1j0i8i30k1j0i24k1j0i13k1.pVumGSMVaVY#imgrc=O0YqNwulN5csQM:

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 ?

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 ?