Using display.actualContentWidth and display.actualContentHeight does not work on iPhone X 11.4 to get the screen size. It works perfectly in the corona simulator, however, on an actual iPhone X and the Xcode iPhone X simulator it shows a wrong size. See the screenshots.
Any ideas?
main.lua
-- Create a vector rectangle sized exactly to the screen area local screenArea = display.newRect( display.screenOriginX, display.screenOriginY, display.actualContentWidth, display.actualContentHeight ) screenArea:translate( screenArea.width\*0.5, screenArea.height\*0.5 ) local actualWidth = math.floor((display.actualContentWidth/display.contentScaleX)+0.5) local actualHeight = math.floor((display.actualContentHeight/display.contentScaleY)+0.5) local \_msg = 'actualWidth/actualHeight: {' .. actualHeight .. ', ' .. actualWidth .. '}' native.showAlert( "Attention!", \_msg, {"Ok"})
config.lua
application = { content = { width = 640,--960, height = 960,--640, scale = "letterbox", fps=30, imageSuffix = { ["@2x"] = 2, --["@3x"] = 4, } }, }