Quirk with contentScaling. I always want to use scaling to switch to @2x images but 1:1 wont.

We removed standard sized images from our app and now use only hi-res versions.

We did this via config.lua, set to always use the @2x set.

Our hack works as expected except in one case where the device resolution is the same as our app’s.

Here’s config.lua

content = { width = 320, height = 480, fps = 30, scale = "letterbox", imageSuffix = { ["@2x"] = 0.1 }, },

This works on all resolutions, it uses the @2x image when I do this:

display.newImageRect("/path/image.png", 480, system.height)

Except when the resolution is the same it is not using the @2x image.

It’s as if there is a scaling module turned off and I’m looking for a way to force it to stay on even at 1:1 scaling.   If in config.lua I set width to 481, one pixel off, then it goes back to using @2x images.

Also If I try load the file explicitly telling it to load @2x it removes the @2x for me.

display.newImageRect("/path/image@2x.png", 480, system.height)

Why not simply rename the graphics to not have @2x in them and drop the imageSuffix table out.

Since you’re specifying the width and height using display.newImageRect() you’re choosing the size you want the image loaded and it will scale like you want.

Rob

Thankyou for your reply Rob.

Renaming the graphics would probably fix it unfortunately it’s a rather large app with many images and there are some extenuating circumstance which makes renaming images a bit awkward. We will probably ending doing that but we were hoping we could find a way to avoid renaming the images.

Why not simply rename the graphics to not have @2x in them and drop the imageSuffix table out.

Since you’re specifying the width and height using display.newImageRect() you’re choosing the size you want the image loaded and it will scale like you want.

Rob

Thankyou for your reply Rob.

Renaming the graphics would probably fix it unfortunately it’s a rather large app with many images and there are some extenuating circumstance which makes renaming images a bit awkward. We will probably ending doing that but we were hoping we could find a way to avoid renaming the images.