Why are some Simulator devices not showing full-screen background image correctly?

I am trying to show a background image. The main lua is simple, just 3 lines of code as below.

The background image is displayed correctly (fully occupying the screen) in most of the Simulator devices. But if I change the Simulator device to iPhone 4S or Samsang Galaxy Tab, the image becomes smaller.

Is this a new bug or I miss some configuration?

main.lua

local bgImg = display.newImage("playBackground.jpg", 1425, 900) bgImg.x = display.contentWidth\*0.5 bgImg.y = display.contentHeight\*0.5

My config.lua

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 = 60, }, launchPad = false, }

It’s because you are setting a fixed size for the image (1425*900) and therefore a fixed aspect ratio (roughly 16:10), but the devices all have different aspect ratios: an iPhone has a much taller narrower ratio (16:9) than an iPad (4:3) for example.

If you need it to fully occupy the screen then instead of setting the width/height values manually, use display.contentWidth and display.contentHeight.

However this will lead to stretching on some devices, so you will need to take that into account when creating the image.

The size 1425 x 900 has the bleed area that should cover all devices for this config.lua. I have played with this config.lua and image size before and it was working.

For example, when I run the code in actual iPad mini, the image fully occupies the screen. Only a few Simulation devices have some problem that I don’t understand.

ok, I found out my mistake:

I was using “display.newImage” instead of “display.newImageRect”

It’s because you are setting a fixed size for the image (1425*900) and therefore a fixed aspect ratio (roughly 16:10), but the devices all have different aspect ratios: an iPhone has a much taller narrower ratio (16:9) than an iPad (4:3) for example.

If you need it to fully occupy the screen then instead of setting the width/height values manually, use display.contentWidth and display.contentHeight.

However this will lead to stretching on some devices, so you will need to take that into account when creating the image.

The size 1425 x 900 has the bleed area that should cover all devices for this config.lua. I have played with this config.lua and image size before and it was working.

For example, when I run the code in actual iPad mini, the image fully occupies the screen. Only a few Simulation devices have some problem that I don’t understand.

ok, I found out my mistake:

I was using “display.newImage” instead of “display.newImageRect”