(Case 41217) The display.pixelHeight and the display.pixelWidth return wrong values on the iPhone 6 plus device.

Hi everyone.

I checked display.pixelHeight and display.pixelWidth values on my iPhone 6 plus.

It returns that the following values.

Version 2015.2650 (2015.6.11)

++++++++++++++++++++++++++++++++++++++++++++++++++++++

Device iPhone 6plus Standard[Settings -> Display & Brightness -> View]

++++++++++++++++++++++++++++++++++++++++++++++++++++++

Jun 14 16:33:40 iPhone TestScreenSize[6986] <Warning>: display.pixelHeight:1481

Jun 14 16:33:40 iPhone TestScreenSize[6986] <Warning>: display.pixelWidth:834

++++++++++++++++++++++++++++++++++++++++++++++++++++++

Device iPhone 6plus Zoomed[Settings -> Display & Brightness -> View]

++++++++++++++++++++++++++++++++++++++++++++++++++++++

Jun 14 16:30:45 iPhone TestScreenSize[6975] <Warning>: display.pixelHeight:1635

Jun 14 16:30:45 iPhone TestScreenSize[6975] <Warning>: display.pixelWidth:921

But Corona simulator shows the following values.

++++++++++++++++++++++++++++++++++++++++++++++++++++++

Corona Simulator

++++++++++++++++++++++++++++++++++++++++++++++++++++++

2015-06-14 16:31:41.276 Corona Simulator[5299:3066990] display.pixelHeight:1920

2015-06-14 16:31:41.276 Corona Simulator[5299:3066990] display.pixelWidth:1080

I really want to the values on the Corona Simulator.

Dose somebody know how I can get them?

The below forum post might provide a bit of clarification:

https://forums.coronalabs.com/topic/57280-different-displayscreenoriginy-values-on-simulator-and-device-iphone6/?hl=%2Biphone+%2Bpixelwidth#

Hi, Alex

Thanks your help. These links are very useful.

After reading them, I could consider the reason that the iPhone 6 plus returns wrong pixel width and pixel height.
 

It should be returning 1080 x 1920.  It has two modes:  UI mode and Graphics mode.  In UI mode it’s 2208 × 1242  in size.  In graphics mode is 1920 x 1080.  The UI mode is scaled down to 1920x1080 in hardware since that’s the physical size of the screen.  I have no idea where those values you are getting on device are coming from.  We do expect that Xcode simulator to provide 2208x1242 as the values for those two calls, but on device and in the Corona SDK simulator you should be getting 1920 and 1080.

Rob

Thanks Rob for replying.

That’s OK. Have you confirmed that on iPhone 6 Plus device?

I’ve reset iPhone 6 plus and I tried test app.

But It returns same values.
 

display.pixelHeight:1481

display.pixelWidth:834

iOS 8.3 (the latest version)

Your config.lua should not be affecting this, but can you post your config.lua?

Rob

Sure. It’s easy to make it.

1.New Project -> Choose a template : Blank

2.Add the following 2 lines.

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

print(“display.pixelWidth:” …display.pixelWidth)

That’s all.

Config.lua

application =

{

    content =

   {

      width = 320,

      height = 480, 

      scale = “letterBox”,

      fps = 30,

    },

}

Thank you all.

The issue was fixed when I made build.settings again.

It was possible to lack the Default launch images settings.

The below forum post might provide a bit of clarification:

https://forums.coronalabs.com/topic/57280-different-displayscreenoriginy-values-on-simulator-and-device-iphone6/?hl=%2Biphone+%2Bpixelwidth#

Hi, Alex

Thanks your help. These links are very useful.

After reading them, I could consider the reason that the iPhone 6 plus returns wrong pixel width and pixel height.
 

It should be returning 1080 x 1920.  It has two modes:  UI mode and Graphics mode.  In UI mode it’s 2208 × 1242  in size.  In graphics mode is 1920 x 1080.  The UI mode is scaled down to 1920x1080 in hardware since that’s the physical size of the screen.  I have no idea where those values you are getting on device are coming from.  We do expect that Xcode simulator to provide 2208x1242 as the values for those two calls, but on device and in the Corona SDK simulator you should be getting 1920 and 1080.

Rob

Thanks Rob for replying.

That’s OK. Have you confirmed that on iPhone 6 Plus device?

I’ve reset iPhone 6 plus and I tried test app.

But It returns same values.
 

display.pixelHeight:1481

display.pixelWidth:834

iOS 8.3 (the latest version)

Your config.lua should not be affecting this, but can you post your config.lua?

Rob

Sure. It’s easy to make it.

1.New Project -> Choose a template : Blank

2.Add the following 2 lines.

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

print(“display.pixelWidth:” …display.pixelWidth)

That’s all.

Config.lua

application =

{

    content =

   {

      width = 320,

      height = 480, 

      scale = “letterBox”,

      fps = 30,

    },

}

Thank you all.

The issue was fixed when I made build.settings again.

It was possible to lack the Default launch images settings.