I still haven’t been able to find the settings for my game to fit the width of an Android screen. I keep reading about orthographic sizes being half of the window dimension of the screen height, but in android there is no way to control the screen dimension. The system upscales/downscales everything as it sees fit.
I am making a 2D Game using the lowest common ratio denominator at 1.5 portraid (iphone), assets at 640x960 resolution. With an Orthographic size set to 1.5, everything runs pixel perfect in iPhone.
So I thought I would only need to change the orthosize of the camera in android to fit different resolutions. I would find the device width, calculate the necessary height the screen would need to have to mantain the 1.5 ratio and then use the screen height to calculate the value of the orthoSize camera. This way the screen would perfectly fit the width of the screen with top bars at the top and bottom if necessary.
But it doesn’t work that way.
Somehow Android doesn’t respect that, the only device that seems to respect those definitions is the Galaxy Nexus. Using a calculated 1.68 ortho size, the display shows an “almost” perfect image, i say perfect because they still have a 5 pixel border on the sides. But i can live with that.
However, if I set the app to display the android top status bar it rescales the app… and those 5 pixels on each side become 10…
So now I am sure the camera is rescaling the imagem properly, but android is somehow rescaling the game view.
In other devices, witch have the same screen resolution (Xperia S comes to mind) it simply doesn’t behave properly. The ortho camera size is calculated ao 1.68 but android simply displays something else.
This is driving me mad. I can’t see a solution to this unless there is a way to set a flag in the app that tells to android NOT to do any system rescaling. But i have searched and searched and can’t find anything on that regard.
Maybe I am missing some obvious solution here?