iPhone 5 (Doesn't Fill the Entire Screen)

Hi all, daily build 912 is up. I wrote up a preliminary guide for iPhone 5 and iOS 6 here that should help elucidate various issues:

http://www.coronalabs.com/blog/2012/09/14/corona-guidelines-iphone-5-and-ios6-preliminary/ [import]uid: 26 topic_id: 30904 reply_id: 123968[/import]

One fix appears to be to add a “Default-568h@2x.png” splash screen file and then the app will no longer be letterboxed. Not sure if Apple has published an official method yet, but I found this in the developer forums and it’s working good for me so far. [import]uid: 135827 topic_id: 30904 reply_id: 123614[/import]

Its probably a Coronas bug as yet. The Team did not have chance as yet to get an iPhone5 to notice the issue (what btw is acceptable by now).

The issue looks like the “same” bug as when the new iPad got into the market (same issues about scaling).

So, I think the best thing is not to speculate but only to wait for the fix because surely it will come from Corona`s Labs IMHO.

Cheers,
Rodrigo. [import]uid: 89165 topic_id: 30904 reply_id: 123619[/import]

@003naveen
What you are seeing for iPhone 5 sounds correct. According to today’s announcement, Apple stated that the iPhone 5 will run all current apps at the “old” resolution, with black bars on both sides. So, instead of stretching it, they are running it in the center of the screen.
Watch 17:50 on today’s keynote:
http://www.apple.com/apple-events/september-2012/
[import]uid: 47723 topic_id: 30904 reply_id: 123625[/import]

@flyingaudio,

Great info and thanks for that. So, Corona has nothing to do with it.

PS: BTW I do not like this info as I do not think the iPhone`s users will like to see black bars and so left for the developers the dirty work of remaking assets (one more time before 1 simple year pass away). :frowning:

[import]uid: 89165 topic_id: 30904 reply_id: 123627[/import]

Corona is not the problem, but they might be the fix. With the different ratio, it seems like we could treat the iPhone 5 as another “odd” screen size, using current scaling techniques to “fill-in” the whole screen. Is there an emulation setting that a plist setting could turn off and then we scale? I don’t know, but there is probably a solution. [import]uid: 47723 topic_id: 30904 reply_id: 123636[/import]

flyingaudio ,

When you say: "Corona is not the problem, but they might be the fix…it seems like we could treat the iPhone 5 as another “odd” screen size, using current scaling techniques to “fill-in” the whole screen."

I agree. Would be really great to see it implemented like that at least instead black bars.
[import]uid: 89165 topic_id: 30904 reply_id: 123642[/import]

Black bars are what Apple intended. A lot of apps use coordinates to place items or check for touches or item placement.
If Corona would stretch and fill out the screen, go against standard Apple approach, a lot of apps would break.
Say you have a puzzle app where the app checks if an item is dropped near 100 pix. Y and 150 pix X.
In the Apple way it doesn’t matter still works. In your approach, the old X would be shifted to new coordinates. Thus breaking the app.

If you build an interface where you specify the X coordinates for your images it would break.

So Corona would actually break a lot more apps than it would fix if it used your solution for all current apps.
[import]uid: 100901 topic_id: 30904 reply_id: 123649[/import]

Juf

Great point!

PS: The way to go is build new apps with new assets for the new dimensions so. [import]uid: 89165 topic_id: 30904 reply_id: 123650[/import]

I think Apple’s approach to support existing apps is the right solution, so you don’t have stretched out images, something the developer didn’t plan for.

With that said, developers will probably want to fill out the screen. But how?

  1. Create two layouts for each screen in your app, and load the appropriate one based on the phone model.

or
2) Use the scaling techniques that Corona Labs already supports.
If you look at all the different screen variations out there, these type of differences are already being handled. I don’t think planning for the iPhone 5 would be any different then designing an app for a 4s and an Android phone. Please correct me if I am wrong. [import]uid: 47723 topic_id: 30904 reply_id: 123657[/import]

I think some of you guys are understanding this wrong. I’ll try to explain it better.

  1. My app is built to be scalable from the beginning. From my current code base, it dynamically scales to all Android sizes, iOS and Kindle.

  2. If you want to remove the black bars on the sides, just add a “Default-568h.png” image into your project, with dimensions of 1136x640. Once you add this new default.png image, iOS will recognize that your app “supports” the iPhone 5 and then *it will let Corona do its dynamic scaling*. Without this default.png image, Corona will NOT use dynamic scaling and you’ll be stuck with the black bars.

Here’s a comparison showing what happens when you add the new default.png image (NO CODE CHANGES WERE MADE):

Without Default-568h.png: https://dl.dropbox.com/u/3371101/WithoutNewDefault.tiff

With Default-568h.png: https://dl.dropbox.com/u/3371101/WithNewDefaultSize.tiff

Once you’ve got your app scaling properly, this is where the next problem comes. I think this is a Corona bug, but I’m not sure:

At the left and right edge where the black bars used to be, there are no touch events being sent. So even though all the content scales perfectly, for some reason, the edges become “dead zones” and no touch inputs can be received from there. The middle portion of the screen works perfectly, it’s just the part that previously used to be letterboxed.

I hope this clears some things up for you! [import]uid: 51654 topic_id: 30904 reply_id: 123670[/import]

EDIT - READ THIS: Anyone reading this, please make sure you read post 11. It clears up a lot of stuff!

So that trick with the default.png worked great to make the app scale and fit the entire screen. However, now the touches aren’t being sent to the app (at the left and right side where the app used to be letterboxed). Corona problem…? The rest of the app receives touches just fine. It’s only the left and right edge having the problems.
[import]uid: 51654 topic_id: 30904 reply_id: 123617[/import]

In my opinion this is NOT a Corona bug because the letterbox mode works as expected for a display that is an odd scale factor of 320x480. Creating the splash screen with those special dimensions is probably telling iOS that your device supports the new screen size. Since Corona still thinks it’s a letterbox device, The touch dead zones are still there except iOS must be scaling the content to fit the full screen.

Since iOS6 is now gone GM, we will look into adding a new iOS5 skin and resolve this display problem.

Thanks for your input.

Tom

[import]uid: 7559 topic_id: 30904 reply_id: 123681[/import]

Tom, Corona does letterbox on all kinds of devices, but touches on black portions of the screen are still sent. If they are not sent for iPhone 5, that’s a bug. [import]uid: 160496 topic_id: 30904 reply_id: 123694[/import]

My game is in portrait, so for me the top 960 pixels receive touch events, but the bottom 176 pixels don’t. So its not exactly a “letterbox issue” but some kind of clipping that is done at 960 pixels. Thank you for prioritizing this and getting out a quick fix if possible! [import]uid: 122310 topic_id: 30904 reply_id: 123700[/import]

Far lower priority, but here are some other issues that I found:

  • When Views slide up or down from the OS, such as Game Center Achievements, Leaderboards, or sending an email, they appear to slide up out of pixel row 960, and then they fill the whole screen after.
    [import]uid: 122310 topic_id: 30904 reply_id: 123703[/import]

Thanks for the reply Tom. Do you have any ETA for a fix on this? I’m sure there are lots of other developers that would also like to submit iPhone 5 updates ASAP so they can have “optimized for iPhone 5” games available immediately after launch.

Thanks again! [import]uid: 51654 topic_id: 30904 reply_id: 123836[/import]

I agree, adding iPhone 5 support should be Corona’s top priority right now. With Apple taking nearly 2 weeks to approve apps now, we need to get ours submitted for review ASAP. [import]uid: 84258 topic_id: 30904 reply_id: 123840[/import]

We are working on it now. When the iPad Retina was released, Apple added extra reviewers and approved apps in record time. Hopefully, that will be the case here too. We will keep everyone updated on the progress. [import]uid: 7559 topic_id: 30904 reply_id: 123841[/import]

Good news. We think we have a fix for the iPhone5 touch issue. It should be available in the next Daily Build (CORRECTION: 912 or later).

You will still need to add the Default-568h.png file (640x1136) to your project to put your app into “tall” mode. Otherwise you will get a 640x960 app centered in the screen.

If you want to fill the entire iPhone5 screen and still use content scaling (320x480), you will need to create a background image that is taller than 480 pixels so it scales to fill the letterbox areas. You also need to set the xAlign and yAlign in config.lua

xAlign = "left", yAlign = "top" },}[/code]The new Mac Simulator now has an iPhone5 skin so you can get everything aligned.One more thing. We found that the iOS Simulator has a strange bug where it will remember if your app had a Default png file and put it into "tall" mode, even if the Default file is no longer in your project. You need to Reset the iOS simulator to get the correct results. [import]uid: 7559 topic_id: 30904 reply_id: 123884[/import]