Eheh, I found that out while doing some testing yesterday. I had been coming up with some code to auto-calculate view width based on the device screen ratio.NOTE : On Android there is a bug, that currently I cannot see how to fix, where for the very first frame in TEST mode then it will report the orientation of the device, and not lock until the next frame (so it may report the screen dimensions as portrait, because the device is held that way on the first frame).
Getting the ratio was simple enough, I just used some code like:
ratio = display_get_width() / display_get_height();
And that worked well and dandy in the final apk and during most testing. However, as you said, if I held the device in Portrait while Testing, it reported the Portrait width and height, resulting in a distorted image once Landscape Lock kicked in. I fixed that relatively easily by forcing the game to calculate the longest dimension over the shortest:
ratio = max(display_get_width(), display_get_height()) / min(display_get_width(), display_get_height());
Then I'd just run the ratio calculations to get an undistorted view for any screen ratio.
Edited by Pabloco, 04 July 2012 - 10:53 PM.











