I posted this a couple of days ago to the Help Desk forum, and got no response. Reposting here in case someone is having the same issue.
And seriously, having a forum named Help Desk where no help is ever given is a bit silly. But never mind that - on to the bugs:
Hi,
I'm working on a game that needs to have a full screen display (no letterboxing) on mobile phones, and I'm doing that by having a wide display that's designed to have all the action near the center, and by positioning on-screen controls dynamically by accessing engine.root.x and doing some math. This works on every iOS device I tested with (in the simulator) except the 3.5" iPhone 4/4s, where I get black bars above and below the active area of the display.
I've done some digging, and I was surprised to find out that the Scale to Fit algorithms are reversed based on the screen's aspect ratio, which I haven't seen documented anywhere. I set my scaling algorithm to StF (Letterbox) even though it does the exact opposite of what the documentation says it would, because I found out that in most cases it did the right thing. Imagine my surprise when I found that Letterbox gets switched to Fill when the aspect ratio is above 1.5!
In my case, changing the line:
widescreen = aspectRatio > 1.5;
to:
widescreen = aspectRatio >= 1.5;
Fixed my problem, but I find this behavior puzzling and arbitrary. The fact that it isn't documented makes it worse. I suspect that what was really meant there was:
widescreen = aspectRatio > 1.0;
Which even works for me on an iPad.
So, what's going on here? The way the code is written simply doesn't work for my game, and seems broken.
Further, what is the reason for reversing the scaling algorithms' behaviors like that?