Android HD screen and low texture memory - Can Users set which image version to load?

In several low end android devices, the screen is considered HD (1200x800 for example), but there is not enough texture memory to load all HD images (the @4x version). I would like to allow users the option to choose in the settings menu of my app, which image resolution to use, so that if the app crashes due to lack of texture memory, they can lower the graphics resolution and still enjoy the game.

is there a way to force corona sdk to use a certain graphics resolution when loading an image?

for example, when using display.newImageRect, ask it to load the @2x version instead of the @4x version of the image.

Thanks.

Hi @rune7,

For this, you might be able to use some method to detect these devices, then set up a different config “bracket” for those devices only which forces @2x over @4x. However, I’m not sure what kind of detection method you would use to determine all of these devices… as shown in this tutorial, system.getInfo() provides many detection options:

http://docs.coronalabs.com/daily/api/library/system/getInfo.html

If you find some method to detect the devices you want to limit, then you could just create another conditional bracket in config.lua for that.

Brent

Hi Brent,

I dont want to automatically detect the device. I want the user to be able to force a lower resolution if he/she finds the device cannot handle the full resolution, as you can find in some PC games (at least in the past).

Doing that may be tricky, but presumably it’s possible. You might need to write some function that handles all of your image output, and based on some scene-wide user-setting flag like “useLowRes”, it uses basic “newImage()” instead of “newImageRect()” if they set it on. I can’t vouch for how well that will work, but it’s worth a shot…

Hi @rune7,

For this, you might be able to use some method to detect these devices, then set up a different config “bracket” for those devices only which forces @2x over @4x. However, I’m not sure what kind of detection method you would use to determine all of these devices… as shown in this tutorial, system.getInfo() provides many detection options:

http://docs.coronalabs.com/daily/api/library/system/getInfo.html

If you find some method to detect the devices you want to limit, then you could just create another conditional bracket in config.lua for that.

Brent

Hi Brent,

I dont want to automatically detect the device. I want the user to be able to force a lower resolution if he/she finds the device cannot handle the full resolution, as you can find in some PC games (at least in the past).

Doing that may be tricky, but presumably it’s possible. You might need to write some function that handles all of your image output, and based on some scene-wide user-setting flag like “useLowRes”, it uses basic “newImage()” instead of “newImageRect()” if they set it on. I can’t vouch for how well that will work, but it’s worth a shot…