Hi guys, I’m completely new to Corona and I’m working on my new game. I have already read about the “Ultimate Config Lua” and the “Modernizing The Config Lua”. So my config.lua file looks like this:
local aspectRatio = display.pixelHeight / display.pixelWidth application = { content = { width = aspectRatio \> 1.5 and 800 or math.ceil( 1200 / aspectRatio ), height = aspectRatio \< 1.5 and 1200 or math.ceil( 800 \* aspectRatio ), scale = "letterBox", fps = 30, imageSuffix = { ["@2x"] = 1.3, }, }, }
And I want to have a background image that covers the whole screen, so I created two images:
background.png = 900x1425
background@2x.png = 1800x2850
But when I change my simulator device to something different than the iPhone 5 I have black borders, and as far as I understood I shouldn’t have them… am I right?
Also the background Image is not covering the whole screen. Why?!
Also I decided to create the following rectangle:
local centerX, centerY = display.contentCenterX, display.contentCenterY local \_W , \_H = display.contentWidth, display.contentHeight local rectangle2 = display.newRect( centerX, centerY, display.pixelWidth , display.pixelHeight ) rectangle2:setFillColor(1, 0, 0)
And the rectangle is not covering the whole screen. Why?!? I thought it should cover it all.
Here I have some screenshots to illustrate what I’m seeing, the background.png and background@2x.png are just a yellow solid color and the rectangle2 is a red rectangle.
Can please someone explain me what I’m misunderstanding?
Thanks!!