get scale value for scale down button?

ok, I tried changing config to width=480 and height=720, and then scalling factors… and I see it will be some work, maybe I can do that somehow faster?

Current status: 

  1. game designed for 320x480 points with @2x = 1.5, @4x = 3.0

  2. graphics designed for 480px, @2x for 960 and @4x for 1920

so in normal mode (not @2-4x) graphics are a bit too large.

widest element I have, button graphic: 

sips -g pixelWidth -g pixelHeight btn\_res\* btn\_res.png pixelWidth: 363 pixelHeight: 84 btn\_res@2x.png pixelWidth: 726 pixelHeight: 168 btn\_res@4x.png pixelWidth: 1452 pixelHeight: 336

option #1

If I’ll change btn_res.png to 70% of it’s size (designed 480 - configured 320) then I’ll have 

btn_res.png 252x59 (designed for 320px screen)

btn_res@2x.png 504x118 (designed for 640px screen)

btn_res@4x.png 1008x236 (designed for 1280px screen)

so it doesn’t sound good. 

option #2

Maybe I can rename btn_res.png (designed for 480) as - tmp name - btn_res@480.png

then copy it and reduce size to 70% - so I have “320” version 

and add in config imageSuffix["@480"] = 1.3 ? 

option #3 

accept my mistake, change config width to 480, height=720 (or other ratio, still reading forum about that topic) - so graphics will match, and fix lua files: adjust text sizes, some other x,y values. 

Maybe also: having 480x720 screen, maybe add graphics for 320 screen like btn_res@small.png. But maybe there’re too little devices with such screen to care about them(?)

option #4

anything else I didn’t think of? 

Can I get somehow config width=320 scale down images btn_res.png from 480? something like imageSuffix[""] = 0.7 ? 

What would you do in such situation?

Thanks Rob for elaborate explanation! :slight_smile:

So, there’s no better option to fix config.lua width 320 with graphics designed for 480, then just change config.lua width to 480 and make adjustments with test sizes and so on?

My app is both portrait and ladscape. However I see that when I changed:

 width = aspectRatio \> 1.5 and 320 or math.ceil( 480 / aspectRatio ), height = aspectRatio \< 1.5 and 480 or math.ceil( 320 \* aspectRatio ),

into width=480, height=720

in landscape I have some black area on the right… But two buttons are on that area, so I assume I can get other elements “go there” too. 

I believe your fastest path is to change your config.lua to 480x720 since that’s what your graphics are designed for.

As for why you have black bars, it’s due to your background being too small. Your background should be based on 540 x 855.

Rob

Ok, I’ve changed config.lua to 480x720 and working over my screens to make necessary adjustments. :slight_smile:

Right now I have 

 ["@2x"] = 1.5, ["@4x"] = 3.000

Would you leave that as it is, or make some adjustments (since width changed from 320 to 480)? 

If you’re content area width is 480px. Your 1x images will load on devices that are 719px or smaller. For 720px to 1439px, the device will use your @2x image. If your device is 1440px or greater, it will use your @4x images.

Rob