Pixel-art scaling issue

Hi,

Our pixel-art game is using a 240x160 letterBox scaled config

application = { content = { width = 160, height = 240, antialias = true, scale = "letterBox", xAlign = "left", yAlign = "top", fps = 60 } }

But we have a problem with the scaled pixel-art images in the game on some devices.

Some pixels within the images have different dimensions. Such as some pixels are 8x8 real pixels, and some are 8x9 and some are 9x8 and some are 9x9

For example when we have this image below

It is scaled like this in the simulator:

In the simulator image you can clearly see the height of the light blue bars are not the same at all, and lots of other pixels are not the correct size. This happens with a lot of stuff in our interface.

Can someone explain me how this happens or can give me tips how to fix this problem

Thanks in advance!

PS. I use nearest neighbor scaling

Hi @pouwelsjochem8,

I assume then you’ve configured things as outlined in this post?

https://forums.coronalabs.com/topic/53962-retro-pixel-style-and-configlua/

If so, then I’m not sure what else you can do. There are too many device aspect ratios and sizes to “ensure” that the pixels will ever be in a predictable ratio like 1:1, 2:1, 4:1, etc. (meaning, the pixels won’t always be just double the size or quadruple the size, you will inevitably get some odd ratios like 3.3:1).

Sorry I can’t be of more help on this. Perhaps somebody in the community can advise better.

Brent

You could try @Lerg’s approach:

http://spiralcodestudio.com/corona-sdk-pro-tip-of-the-day-36/

Hi @pouwelsjochem8,

I assume then you’ve configured things as outlined in this post?

https://forums.coronalabs.com/topic/53962-retro-pixel-style-and-configlua/

If so, then I’m not sure what else you can do. There are too many device aspect ratios and sizes to “ensure” that the pixels will ever be in a predictable ratio like 1:1, 2:1, 4:1, etc. (meaning, the pixels won’t always be just double the size or quadruple the size, you will inevitably get some odd ratios like 3.3:1).

Sorry I can’t be of more help on this. Perhaps somebody in the community can advise better.

Brent

You could try @Lerg’s approach:

http://spiralcodestudio.com/corona-sdk-pro-tip-of-the-day-36/