Dynamic resolution for iPad

Can someone point me in the right direction to display images in the correct size when using an iPad? I currently use the image.png and image@2x.png settings for retina, however this makes my game backgrounds a bit too short on the top and bottom of the screen. Is there a way to have a slightly larger background on iPads? Sorry if this has been answered but many searches came up with nothing. Thanks.

Aaron [import]uid: 31262 topic_id: 12961 reply_id: 312961[/import]

I made my backgrounds sized correctly for the iPad (1024x768 and 512x384) and just center them on the iPhone. You can’t put anything critical in the areas that are going to get cropped on the iPhone.

Of course I have a little bit of a non-standard config.lua file too:

[lua]if system.getInfo(“model”) ~= “iPad” then
application =
{
content =
{
width = 320,
height = 480,
scale = “letterbox”,

imageSuffix =
{
["@2x"] = 2,
},
},
}
else
application =
{
content =
{
width = 384,
height = 512,
scale = “letterbox”,
imageSuffix =
{
["@2x"] = 2,
},
},
}

end[/lua]
[import]uid: 19626 topic_id: 12961 reply_id: 47574[/import]

Thanks for replying Rob.

What if I were to use your same setup in the config.lua however I used a different suffix for iPad backgrounds? Can you make it point to a different image altogether used just for iPad? A couple of my backgrounds I can’t really have them looking compressed or stretched [import]uid: 31262 topic_id: 12961 reply_id: 47583[/import]

OK so I went through many scenarios last night and have come up with nothing usable. I’m gonna guess there’s no way to do this unless you zoom your images which results in some clipping on the sides, or you stretch your images which results in everything looking too tall. [import]uid: 31262 topic_id: 12961 reply_id: 47688[/import]

To your first point, sure, you can change the suffix to say @ipad if you want and save iPad specific versions of your background like background@ipad.png

I’m clipping my images on the iPhone, but in my case, I built them so it didn’t matter.

You can also, though it may be a bad practice, test for the device in your lua files.

[lua] if system.getInfo(“model”) == “iPad” then
background = display.newImage(“ipadbackground.png”)
else
background = display.newImage(“iphonebackground.png”)
end[/lua]

But it would be nice to not have to program in device specific settings like this. [import]uid: 19626 topic_id: 12961 reply_id: 47698[/import]

I tried making a suffix for ipad only but that didn’t work. It seemed to always use the @2x images.

I will also look into try what you suggested and putting code right in the lua file. Since it just loads up once at the beginning of the level I don’t think it would be too much of an issue. Thanks again for the reply. [import]uid: 31262 topic_id: 12961 reply_id: 47705[/import]