Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

same code, different results on corona simulator and iOS simuator(iPhone X)
Started by pickerel Nov 07 2017 07:28 PM

6 replies to this topic
iphonex iphone x
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

pickerel

[GLOBAL: userInfoPane.html]
pickerel
  • Contributor

  • 132 posts
  • Corona SDK

corona sdk version:Version 2017.3170 (2017.11.7)

 

screenshots:

Attached File  屏幕快照-2017-11-08-上午11.12.48.jpg   28.89KB   1 downloads

 

my code: Attached File  testIphoneX.zip   55.23KB   13 downloads

 

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 )


[TOPIC: post.html]
#2

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,244 posts
  • Enterprise

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

 

Rob



[TOPIC: post.html]
#3

lpalmieri

[GLOBAL: userInfoPane.html]
lpalmieri
  • Observer

  • 26 posts
  • Corona SDK

2017.3179 - the issue still exists.

 

Are there any updates on this?



[TOPIC: post.html]
#4

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,244 posts
  • Enterprise

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



[TOPIC: post.html]
#5

lpalmieri

[GLOBAL: userInfoPane.html]
lpalmieri
  • Observer

  • 26 posts
  • Corona SDK

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.



[TOPIC: post.html]
#6

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,244 posts
  • Enterprise

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



[TOPIC: post.html]
#7

KindaichiShota

[GLOBAL: userInfoPane.html]
KindaichiShota
  • Observer

  • 20 posts
  • Corona SDK

Thank you Rob, for the information




[topic_controls]
[/topic_controls]