Auto scale doesn't work on Android?

Hi guys,

I’m trying to do this for my android build :

  1. if the screen width is 1280 or less then my game will handle the scaling itself

  2. if the screen width is more than that then I’ll use auto-scale since i couldn’t be bothered to provide really hi-res images/texture.

This is what my config.lua looks like :

if (display.pixelWidth\>1280) then         application =          {             content =             {                 width = 800,                 height = 1280,                 scale = "letterBox",                 xAlign = "center",                 yAlign = "center",                 fps = 60,             },         }     else         application =          {             content =             {                 fps = 60,             },         }     end  

But it seems that config doesn’t work as I tested on kindle Fire HD 9 and other newer device that has 1920x1080 resolution, the game doesn’t scale at all. 
 

Is there something that I do wrong in the config?

Thanks

Hi @yanuar,

By not putting a “scale” parameter in the “<= than 1280” set, you’re telling Corona to use “none” for scaling, so it won’t handle scaling at all.

Have you considered a more comprehensive scaling management setup like the one presented in the “Ultimate config.lua”?

http://www.coronalabs.com/blog/2012/12/04/the-ultimate-config-lua-file/

Regards,

Brent

Yes, for screen width <1280 i don’t use scale at all. The problem isn’t for any screen that has width < 1280 but when it’s >1280 I want to scale it.

I’m asking about  the part where  it says if pixelWidth>1280 then just scale :

if (display.pixelWidth\>1280) then &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;application =&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;content = &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;width = 800, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;height = 1280, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;scale = "letterBox", &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xAlign = "center", &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;yAlign = "center", &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fps = 60, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} &nbsp;

It doesn’t seem to work at all.

ps : I’ve done this config before for iOS device basically saying if it’s ipad2 - iphone don’t scale but anything newer than that just scale. I just can’t seem to make it work for android?

nvm, i solved it. It should be :

if (display.pixelHeight\>1280) then &nbsp;

Hi @yanuar,

By not putting a “scale” parameter in the “<= than 1280” set, you’re telling Corona to use “none” for scaling, so it won’t handle scaling at all.

Have you considered a more comprehensive scaling management setup like the one presented in the “Ultimate config.lua”?

http://www.coronalabs.com/blog/2012/12/04/the-ultimate-config-lua-file/

Regards,

Brent

Yes, for screen width <1280 i don’t use scale at all. The problem isn’t for any screen that has width < 1280 but when it’s >1280 I want to scale it.

I’m asking about  the part where  it says if pixelWidth>1280 then just scale :

if (display.pixelWidth\>1280) then &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;application =&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;content = &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;width = 800, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;height = 1280, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;scale = "letterBox", &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xAlign = "center", &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;yAlign = "center", &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fps = 60, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} &nbsp;

It doesn’t seem to work at all.

ps : I’ve done this config before for iOS device basically saying if it’s ipad2 - iphone don’t scale but anything newer than that just scale. I just can’t seem to make it work for android?

nvm, i solved it. It should be :

if (display.pixelHeight\>1280) then &nbsp;