For example, you have a sprite of mario with a size of 20px x 20px. This sprite however was made for a game resolution of 1000px x 1000px. What if you want to provide a different game resolution as an in-game option? You could offer to change the game resolution to 2000px x 2000px, but then Mario should be drawn again for this particular resolution. And if you offer many resolutions, this can be very much to draw and the amount of space the image files will take, are going to get too big.

So, my question, what's the trick here?

  • 2
    \$\begingroup\$ No trick... you can either draw him scaled up (so his pixels are twice as big), you can programmatically scale him up to double his pixels (maybe with some cleverness he'll look ok, but it's not great), or you can provide alternate artwork. Could also provide the highest resolution and programmatically scale down, still not great... For a pixel-ish game, perhaps consider not offering many resolutions. :) \$\endgroup\$ – david van brink Jan 21 '15 at 4:33

If you've made sprites at a low resolution, they become smaller when you change to a higher resolution. To counteract this, scale your sprite at runtime. Just bear in mind: if you do this, you won't see a difference between the high and low resolution, because you're simply scaling a low resolution sprite. This is only useful if you want to adapt to 16:9 screens as well as 4:3. If you want your sprites to look PRETTIER at a high resolution, just draw them in that high resolution by hand, and scale them down if you are using a lower resolution.

By scaling down, I actually mean rendering them at a scaled size at runtime. Don't create multiple assets for multiple resolutions. That's insane.

I mentioned 16:9 and 4:3. When the ratio between the width and height of the screen changes, you'll have to decide for yourself how you want to handle that. At some point, you've decided to show a certain area of your game world on screen. If I change from 4:3 to 16:9 (or any other widescreen format), are you going to add some viewable area to the sides of your already viewable area, or are you going to cut some parts off the top? In other words, you'll have to decide for yourself if you need the width to stay the same, or you need the height to stay the same.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.