We have the following in our config.lua, using imageSuffix scale that are similar to the recommended. The issue we are running into is that on some devices while the display Scale would mean that it would be using @2x or @4x images, but it’s obvious during testing that the device is sluggish handling the higher resolution images.
content = { width = 320, height = 480, scale = "letterBox", xAlign = "center", yAlign = "center", imageSuffix = { ["@2x"] = 1.5, ["@4x"] = 3.0, }, },
So, we have been trying to see if it is possible for us to manually reset the imageSuffix down on those specific devices, basically do something like this in main.lua:
display.imageSuffix = "@2x"; -- for @2x -- or display.imageSuffix = nil; -- for @1x
Base on the testing we have done, it appears that manually setting to “@2x” works (and it seems to pick up the right images), but for some reason we can’t seem to set it to nil. It just ignores our attempt to set it.
My questions are:
-
Is doing this OK? Or would it cause problems within Corona? Is there a better approach?
-
How do I set it down to nil for @1x.
Just FYI. Another reason we are interested in this topic is that our app downloads a fair bit of visual assets once the user launches the app. This is a problem for some low-end Android devices that have very limited disk space. So one idea we are toying with is to download only the @1x asset, and downgrade that user’s screen to @1x to save on disk memory (even though the device screen would have normally called for @2x).
Appreciate any input!