Ultimate config.lua and black bars (pulling my hair!)

I’ve just read the article “Tutorial: the Ultimate “config.lua” File” and thought I would give it a go for my new app. Here’s the entirety of my config.lua (which is a literal copy/paste from the blog post)

local aspectRatio = display.pixelHeight / display.pixelWidth application = { &nbsp; &nbsp;content = { &nbsp; &nbsp; &nbsp; width = aspectRatio \> 1.5 and 800 or math.ceil( 1200 / aspectRatio ), &nbsp; &nbsp; &nbsp; height = aspectRatio \< 1.5 and 1200 or math.ceil( 800 \* aspectRatio ), &nbsp; &nbsp; &nbsp; scale = "letterBox", &nbsp; &nbsp; &nbsp; fps = 60, &nbsp; &nbsp; &nbsp; imageSuffix = { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;["@2x"] = 1.3, &nbsp; &nbsp; &nbsp; }, &nbsp; &nbsp;}, }

Now, my problem is that on an iPhone 5 I get black bars and can’t use the space for anything; even though I place objects there, they just don’t get rendered.

Here’s my entire main.lua:

display.setDefault( "background", 0.5, 0.5, 0.5 ) display.setStatusBar( display.HiddenStatusBar ) local background = display.newImageRect("images/background.png", 1425, 900) background.x = display.contentCenterX background.y = display.contentCenterY

I’ve included screenshots of what I’m seeing in the different devices (ACTUAL devices, not simulator, only I converted them to jpg so that the forum would let me post them). I’m also including the original background.jpg image (1425 × 900).

Is there a way that I could use the entire iphone 5 screen? I’m ok with relative positioning -like the article says you should do- as I’ve been used this technique many times before on other platforms.

What files do you have for default in your project - thats the common reason for black bars - tons of forum entries on this - you need the tall default image.

T.

Thanks, that was exactly my problem. I didn’t have an iPhone 5 required image. Just in case anyone else stumbles upon this please take a look here: http://docs.coronalabs.com/guide/distribution/buildSettings/index.html#launchimage

If you’re developing an app for  iPhone5  compatibility, you might be tempted to wait until the project is complete to create these launch images. However, you must at least include the Default-568h@2x.png file from the start, even if it’s a blank image for testing. This activates the iPhone5 “tall” mode. As indicated above, this image must be exactly 640×1136 in size — do  not  flip it to 1136×640 for a landscape app.

What files do you have for default in your project - thats the common reason for black bars - tons of forum entries on this - you need the tall default image.

T.

Thanks, that was exactly my problem. I didn’t have an iPhone 5 required image. Just in case anyone else stumbles upon this please take a look here: http://docs.coronalabs.com/guide/distribution/buildSettings/index.html#launchimage

If you’re developing an app for  iPhone5  compatibility, you might be tempted to wait until the project is complete to create these launch images. However, you must at least include the Default-568h@2x.png file from the start, even if it’s a blank image for testing. This activates the iPhone5 “tall” mode. As indicated above, this image must be exactly 640×1136 in size — do  not  flip it to 1136×640 for a landscape app.