iPhone 6 Plus - Pixel Perfect Rendering

We now know that on an iPhone 6 Plus, everything is rendered at a virtual pixel resolution of 1242 x 2208 and then downsampled to the device’s physical pixel resolution of 1080 x 1920.

I haven’t gotten my hands on an iPhone 6 Plus yet and hence the following questions.

For iPhone 6 Plus –

  1. Within Corona SDK, what values will be returned for display.pixelWidth and display.pixelHeight? Will it be the physical resolution of 1080 x 1920? Or does the Corona API rely on iOS for these values and because of this will 1242 x 2208 be reported by iOS and in turn Corona will do the same? I’m not entirely sure of this as Apple mandates that the launch images for iPhone 6 Plus be of the sizes 1242 x 2208 (portrait) and 2208 x 1242 (landscape).

  2. The concept of downsampling is not new to Corona developers. It usually produces great results. However, one area where this approach falls a bit short is graphics drawn sharply at a pixel-perfect level (one example is Photoshop pixel patterns that contain minute and intricate details). If such an image were to be downsampled, the image does look a bit blurry. To avoid such problems on the iPhone 6 Plus, can we render everything at 1080 x 1920? Is that allowed or even possible?

For the 6 plus, .pixelWidth and .pixelHeight return 1242 and 2208 respectfully (tested on a device and in the Xcode simulator).  The device will then downsample.  The current 6 plus skin in the SDK reports 1080 and 1920, and I’ve filed a bug report to get that changed.

If you render your art at 1080 x 1920, it will get sized up to 1242x2208 and then downsized back to 1080x1920.  I would trust Apple to handle this correctly, just do 1242x2208.

Rob

Wow - weird to not have pixelperfect control at least on a device-specific level.

Thanks, Rob.

I may have been mistaken on this.  Further testing shows the iPhone 6 plus device reports 1080 x 1920 and Apples documentation seems to confirm this.  OpenGL uses 1080x1920, UIKit uses the larger size.  Since Corona apps are OpenGL…

We are doing further tests to learn more about how these new content areas affect our apps.  Stay tuned for more information.

Rob 

When I print the display.pixelHeight in my config.lua for an iPhone 6, the display.pixelHeight in the Xcode debug console shows 960, hence my config code always uses my standard iPhone setup of 640x960 screen size instead of a wider screen size it should use when display.pixelHeight > 960. How’s this possible? Didn’t have this problem in other earlier builds.

print(“display.pixelHeight:”…tostring(display.pixelHeight))

if display.pixelHeight > 960 then

–do iPhone 5,6  640x1136 letterBox

else

–do iPhone 640x960 letterBox

I’m using corona build 2014.2481, Xcode6.1, OS X Yosemite.

I remember seeing a forum post that Xcode 6.1 may have broken Corona’s ability to select the device to simulate.  You’re most likely getting an iPhone 4/4s device regardless of what you had in the Corona Simulator.

Rob

@rob, you’re right, the simulator correctly shows the screen resolution and correctly chooses the right screen/ratio size to use for the game, but when running the game on the actual device (iphone6 plugged into the mac), and simply viewing print statements from my game’s config.lua from within Xcode’s device console the screen resolution incorrectly shows in the console and for some reason corona is also running the game on the actual iPhone 6 in 640x960 mode/ratio. Hence no matter what I do, even if i set the width/height in config.lua to be 640x1136 (whether using zoomEven or letterBox) it still runs the game with a ratio of 640x960 (i.e.; get black bars on either side of the game). I’ve tried build .2490 as well as older builds and same issue. I wasn’t aware this was happening on the iPhone 6 until I actually bought an iPhone 6 to test on (since simulator seemed fine). Does the build.settings have anything to do with the screen ration/size the game uses or is it purely the config.lua that controls this?

You still have to have a Default-568h@2x.png image to trigger tall mode in the folder with your main.lua.

Then, if you do nothing else, you will be in iPhone 5 stretch mode.  That is the 640x1136 is just scaled up to fit the screen in question.  If you want to get the device’s actual values, you have to include some things in your build.settings. One way involves static images and a new table that gets added to your build.settings.  It’s in the Corona build guide:  http://docs.coronalabs.com/guide/distribution/buildSettings/index.html#launch-images

While this will take care of your screen size things, it however will not get you labeled in the iTunes Store to be “Optimized for iPhone 6 and 6 plus”.  To do that you have to approach your launch images differently:  http://coronalabs.com/blog/2014/10/21/tutorial-building-multi-screen-launch-images-using-xcode-6/

Rob

For the 6 plus, .pixelWidth and .pixelHeight return 1242 and 2208 respectfully (tested on a device and in the Xcode simulator).  The device will then downsample.  The current 6 plus skin in the SDK reports 1080 and 1920, and I’ve filed a bug report to get that changed.

If you render your art at 1080 x 1920, it will get sized up to 1242x2208 and then downsized back to 1080x1920.  I would trust Apple to handle this correctly, just do 1242x2208.

Rob

Wow - weird to not have pixelperfect control at least on a device-specific level.

Thanks, Rob.

I may have been mistaken on this.  Further testing shows the iPhone 6 plus device reports 1080 x 1920 and Apples documentation seems to confirm this.  OpenGL uses 1080x1920, UIKit uses the larger size.  Since Corona apps are OpenGL…

We are doing further tests to learn more about how these new content areas affect our apps.  Stay tuned for more information.

Rob 

When I print the display.pixelHeight in my config.lua for an iPhone 6, the display.pixelHeight in the Xcode debug console shows 960, hence my config code always uses my standard iPhone setup of 640x960 screen size instead of a wider screen size it should use when display.pixelHeight > 960. How’s this possible? Didn’t have this problem in other earlier builds.

print(“display.pixelHeight:”…tostring(display.pixelHeight))

if display.pixelHeight > 960 then

–do iPhone 5,6  640x1136 letterBox

else

–do iPhone 640x960 letterBox

I’m using corona build 2014.2481, Xcode6.1, OS X Yosemite.

I remember seeing a forum post that Xcode 6.1 may have broken Corona’s ability to select the device to simulate.  You’re most likely getting an iPhone 4/4s device regardless of what you had in the Corona Simulator.

Rob

@rob, you’re right, the simulator correctly shows the screen resolution and correctly chooses the right screen/ratio size to use for the game, but when running the game on the actual device (iphone6 plugged into the mac), and simply viewing print statements from my game’s config.lua from within Xcode’s device console the screen resolution incorrectly shows in the console and for some reason corona is also running the game on the actual iPhone 6 in 640x960 mode/ratio. Hence no matter what I do, even if i set the width/height in config.lua to be 640x1136 (whether using zoomEven or letterBox) it still runs the game with a ratio of 640x960 (i.e.; get black bars on either side of the game). I’ve tried build .2490 as well as older builds and same issue. I wasn’t aware this was happening on the iPhone 6 until I actually bought an iPhone 6 to test on (since simulator seemed fine). Does the build.settings have anything to do with the screen ration/size the game uses or is it purely the config.lua that controls this?

You still have to have a Default-568h@2x.png image to trigger tall mode in the folder with your main.lua.

Then, if you do nothing else, you will be in iPhone 5 stretch mode.  That is the 640x1136 is just scaled up to fit the screen in question.  If you want to get the device’s actual values, you have to include some things in your build.settings. One way involves static images and a new table that gets added to your build.settings.  It’s in the Corona build guide:  http://docs.coronalabs.com/guide/distribution/buildSettings/index.html#launch-images

While this will take care of your screen size things, it however will not get you labeled in the iTunes Store to be “Optimized for iPhone 6 and 6 plus”.  To do that you have to approach your launch images differently:  http://coronalabs.com/blog/2014/10/21/tutorial-building-multi-screen-launch-images-using-xcode-6/

Rob