Corona not using retina graphics

There’s no way I can make Corona use my retina graphics.

I’ve used Rob’s ultimate config lua, and also some other solutions, but Corona won’t load the files. I noticed it when testing on an iPad, where it’s clear that the correct files are not being loaded.

This is a piece of my config.lua (iPad section):

if ( string.sub( system.getInfo("model"), 1, 4 ) == "iPad" ) then application = { content = { width = 360, height = 480, scale = "letterBox", xAlign = "center", yAlign = "center", imageSuffix = { ["-hd"] = 1.5, --["@4x"] = 3.0, }, fps = 60, }, }

But it keeps using the low res files. If I change the imageSuffix from “-hd” to whatever, it always loads the low resolution images. Even changing the ratio from 1.5 to 0.1 won’t force it to load the HD files.

Is the same as if my -hd files don’t exist so it falls back to the low res ones.

Any ideas?

Thanks

When you load your images, are you using display.newImage or display.newImageRect?  You need to use display.newImageRect in order to get your high-resolution images swapped in.

  • Andrew

Oh man… Thank you so much.

How about button images? 

Also… any trick to avoid having to set the rect size by hand, and load it from the png file you want to use?

I don’t think there’s a way to read the dimensions of the base-resolution png automatically and use those values for display.newImageRect.

  • Andrew

When you load your images, are you using display.newImage or display.newImageRect?  You need to use display.newImageRect in order to get your high-resolution images swapped in.

  • Andrew

Oh man… Thank you so much.

How about button images? 

Also… any trick to avoid having to set the rect size by hand, and load it from the png file you want to use?

I don’t think there’s a way to read the dimensions of the base-resolution png automatically and use those values for display.newImageRect.

  • Andrew