Background image not showing up in Xcode simulator

Hi folks,

I’m nearing completion on my first Corona-powered game and things have been going pretty well, until a few days ago when I tried for the first time to build for iOS.

Let me preface this by saying I’m not a Mac guy generally, but I bought myself a Mini so I could complete this project. After the initial getting familiar with things phase I got the game built… had some initial problems to correct but I got them taken care of and things are working well now in the Xcode simulator (haven’t tried on a real device yet) except for one problem I can’t figure out.

I’ve targeted the game to a resolution of 480x800 using letterbox scaling, which is the target for my primary device (Samsung Galaxy S Android). So, I have some background images sized at 800x480 (game plays in landscape mode). In the Corona simulator everything works fine, and that’s also true on all my Android devices.

However, in the Xcode simulator what happens is the background isn’t scaled at all. I’m not doing anything fancy, as you can see:

local background = display.newImage(“game_background_1.png”);
background:setReferencePoint(display.TopLeftReferencePoint);
background.x = 0;
background.y = 0;
game.currentLevel.dg:insert(background);

Every other graphic in the game seems to be getting scaled properly, but not the full-screen backgrounds. I’ve tried a number of things (different reference point, not inserting into a group) but none of them seems to matter.

I’m sure this has something to do with scaling that I’m not taking into account but I’ve been banging my head on the desk for a while now trying to figure it out with no luck. Any help would be greatly appreciated!

Thanks,
Frank [import]uid: 10600 topic_id: 26231 reply_id: 326231[/import]

Hmm, adding ,true as the second argument to newImage() seems to resolve the problem (based on another post I found via some searching)… although, to be honest, I don’t understand why that would have that effect… reading the docs for that argument I wouldn’t have guessed it would make that difference.

I’d love to understand that, but at least I seem to have solved my own problem :slight_smile: [import]uid: 10600 topic_id: 26231 reply_id: 106316[/import]