0
\$\begingroup\$

This question already has an answer here:

I'm planning to develop a 2D game for android devices by using simple Canvas Surfaces (I know that OpenGL might be more efficient - but Canvas should definitely be enough for my type of game).

I'm currently researching on how I should handle different screen sizes/resolutions/ratios of the different android devices. I don't think it's a big deal to scale a bitmap if the screen size is just 920x512 instead of 1920x1024 (for example) - but what about completely different ratios? Like 1200x800px screens? I would have to stretch these bitmaps, or just make more objects visible from my game, which would normally be hidden in shorter screens.

I didn't really find anything useful on my research (mainly some discussions about Canvas VS OpenGL...) - so I'm giving it a try here.
What's the best/most common used technique to adjust a game to different screen sizes? Other than just putting black borders along my game, if the width/height is too large.

\$\endgroup\$

marked as duplicate by MichaelHouse Oct 28 '14 at 14:18

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

0
\$\begingroup\$

If the aspect ratio remains constant, just scale the bitmaps. GUI elements might need some different handling though. For a more robust approach:

  • Do your research into what resolutions are available for your target platforms and pick the most often used ones
  • Create GUI configurations (ideally, purely visual rather than making more objects visible, etc) for the most common resolutions
  • For a resolution that you do not support, find the resolution/aspect that's closest and programmatically generate a GUI configuration which resembles that.
\$\endgroup\$

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