I have a little trouble with a letterbox automatic screen scaling.
I develop my game on Nexus S it has 480 * 800 while logical 320 * 480.
When I show my score text field in 0, 0 it's showing in about 0, 20.
I think this is because different ratio between 480 * 800 (1.67) and 320 * 480 ( 1.5).
So I wrote the following code to know distance from logical y = 0 to upper border of screen and
y = 480 to lower (assuming they are same):
local ratio = application:getDeviceWidth() / application:getLogicalWidth()
local screenOffset = (application:getDeviceHeight() - ratio * application:getLogicalHeight()) / (2 * ratio)
But appears that my game screen located not in center by Y coordinate. Offset from upper border is less than from lower.
How can I calculate offset so I could show my scores in the 0,0 ?
ps: sorry for my English