same code, different results on corona simulator and iOS simuator(iPhone X)

corona sdk version:Version 2017.3170 (2017.11.7)

screenshots:

my code: 

config.lua

application = { content = { width = 1536, height = 2048, scale = "letterbox", fps = 60, --[[imageSuffix = { ["@2x"] = 2, ["@4x"] = 4, }, --]] }, }

main.lua

native.setProperty( "androidSystemUiVisibility", "immersiveSticky" ) display.setStatusBar( display.HiddenStatusBar ) display.setDefault( "background", 0, 1, 0, 1 ) local safeArea = display.newRect( display.safeScreenOriginX, display.safeScreenOriginY, display.safeActualContentWidth, display.safeActualContentHeight ) safeArea:translate( safeArea.width\*0.5, safeArea.height\*0.5 )

We still have some discrepancies between the simulator and the Xcode simulator that our team is working to resolve.

Rob

2017.3179 - the issue still exists.

Are there any updates on this?

Using the sample project above on 3179 and making it a 320x480 project (just for my sanity) and making this the main.lua:

----------------------------------------------------------------------------------------- -- -- main.lua -- ----------------------------------------------------------------------------------------- -- Your code here native.setProperty( "androidSystemUiVisibility", "immersiveSticky" ) display.setStatusBar( display.HiddenStatusBar ) display.setDefault( "background", 0, 1, 0, 1 ) local safeArea = display.newRect( display.safeScreenOriginX, display.safeScreenOriginY, display.safeActualContentWidth, display.safeActualContentHeight ) safeArea:translate( safeArea.width\*0.5, safeArea.height\*0.5 ) -- safeArea:setFillColor(1, 0, 0, 1) local a = display.newText( string.format("%0.3f", display.safeScreenOriginX) .. ", " .. string.format("%0.3f", display.safeScreenOriginY ).. ", " .. string.format("%0.3f", display.safeActualContentWidth) .. ", " .. string.format("%0.3f", display.safeActualContentHeight) , display.contentCenterX, display.safeScreenOriginY + 50, native.systemFont, 16 ) a:setFillColor(0) local b = display.newText( string.format("%0.3f", display.screenOriginX) .. ", " .. string.format("%0.3f", display.screenOriginY) .. ", " .. string.format("%0.3f", display.actualContentWidth) .. ", " .. string.format("%0.3f", display.actualContentHeight) , display.contentCenterX, display.safeScreenOriginY + 100, native.systemFont, 16 ) b:setFillColor(0)

And I get identical numbers on the Corona iPhone X simulator (macOS) and the Xcode simulator.  So this appears to work as expected.

Rob

Hey Rob, thanks for this.

It seems the issue was in the config.lua with a combination of “zoomEven” and different width/height.

Setting these to “letterbox” and 320x480 seemed to work fine though I loose the ability to use the zoom even feature which is actually fine for this project I am working on.

I doubt the width/height matters much.  It was just easier for me to understand the numbers I was looking at when scaled to a size I work in rather than one I don’t.

zoomEven shouldn’t matter either, the numbers should be the same in both simulators. Now zoomEven is going to cause a much more drastic zooming effect in particular when you start with an iPad aspect ratio and you’re zooming to the extreme aspect ratio that the iPhone X is.

Rob

Thank you Rob, for the information

We still have some discrepancies between the simulator and the Xcode simulator that our team is working to resolve.

Rob

2017.3179 - the issue still exists.

Are there any updates on this?

Using the sample project above on 3179 and making it a 320x480 project (just for my sanity) and making this the main.lua:

----------------------------------------------------------------------------------------- -- -- main.lua -- ----------------------------------------------------------------------------------------- -- Your code here native.setProperty( "androidSystemUiVisibility", "immersiveSticky" ) display.setStatusBar( display.HiddenStatusBar ) display.setDefault( "background", 0, 1, 0, 1 ) local safeArea = display.newRect( display.safeScreenOriginX, display.safeScreenOriginY, display.safeActualContentWidth, display.safeActualContentHeight ) safeArea:translate( safeArea.width\*0.5, safeArea.height\*0.5 ) -- safeArea:setFillColor(1, 0, 0, 1) local a = display.newText( string.format("%0.3f", display.safeScreenOriginX) .. ", " .. string.format("%0.3f", display.safeScreenOriginY ).. ", " .. string.format("%0.3f", display.safeActualContentWidth) .. ", " .. string.format("%0.3f", display.safeActualContentHeight) , display.contentCenterX, display.safeScreenOriginY + 50, native.systemFont, 16 ) a:setFillColor(0) local b = display.newText( string.format("%0.3f", display.screenOriginX) .. ", " .. string.format("%0.3f", display.screenOriginY) .. ", " .. string.format("%0.3f", display.actualContentWidth) .. ", " .. string.format("%0.3f", display.actualContentHeight) , display.contentCenterX, display.safeScreenOriginY + 100, native.systemFont, 16 ) b:setFillColor(0)

And I get identical numbers on the Corona iPhone X simulator (macOS) and the Xcode simulator.  So this appears to work as expected.

Rob

Hey Rob, thanks for this.

It seems the issue was in the config.lua with a combination of “zoomEven” and different width/height.

Setting these to “letterbox” and 320x480 seemed to work fine though I loose the ability to use the zoom even feature which is actually fine for this project I am working on.

I doubt the width/height matters much.  It was just easier for me to understand the numbers I was looking at when scaled to a size I work in rather than one I don’t.

zoomEven shouldn’t matter either, the numbers should be the same in both simulators. Now zoomEven is going to cause a much more drastic zooming effect in particular when you start with an iPad aspect ratio and you’re zooming to the extreme aspect ratio that the iPhone X is.

Rob

Thank you Rob, for the information