Your config.lua won’t work.
display.contentWidth and display.contentHeight won’t exist until you set width and height in config.lua.
You also do not need to make width and height match the exact device specifications. You can make the width 320 and height 480 and Corona will scale things for you.
The question you have to ask yourself is do you want the top left to be 0, 0, and have a contentWidth and contentHeight that varies from device to device or can you better imagine a fixed box in the center of your screen and you may have visible areas outside that fixed box.
Either do this:
application = { content = { width = 320, height = 480, scale = "letterbox", fps = 60, imageSuffix = { ["@2x"] = 1.5, ["@4x"] = 3.0, }, }, }
or
local aspectRatio = display.pixelHeight / display.pixelWidth application = { content = { width = aspectRatio \> 1.5 and 320 or math.ceil( 480 / aspectRatio ), height = aspectRatio \< 1.5 and 480 or math.ceil( 320 \* aspectRatio ), scale = "letterbox", fps = 60, imageSuffix = { ["@2x"] = 1.5, }, }, }
display.pixelHeight and .pixelWidth are known values during the processing of config.lua but display.contentWidth and display.contentHeight are defined after the config.lua is processed and we know what you want your content area to be.
Rob