0

I am new to Android development and am currently creating a Space Invaders game to help me familiarise myself with surfaceview's, bitmaps, canvases, threads etc etc.

So far so good. What I currently have runs in a real tablet quite nicely.

However, on an emulator for a low dpi resolution it looks awful.

I realise that Android screens come in many different resolutions and I might need to scale my sprites down if the resolution is lower than I expect.

I just can't quite get to grips with the best way to ensure everything "fits": that is to say all sprites are on screen, in proportion, and when they move, they move proportionally. On a PC I'd use a back-buffer of a fixed size that never grows or shrinks, blit to that, then scale the back buffer up/down to the extents required, but on Android??

I know somewhat about screen densities and have created mdpi and hdpi sprites (48 x 24 and 48 x 32 pixels width and height respectively) and I'm wondering if these sprites are in proportion for the dpi settings?

Any help is appreciated.

  • Have a look at the AndEngine library. It will do all this resolution headaches for you. – bos Mar 30 '12 at 10:34
  • Already looking at the AndEngine library, its overkill for what I need, tbh. I have sprites of a fixed width, when BitmapFactory is decoding them it scales them, so I set the options inScale to false so it doesn't bother, I want to do my own scaling. I don't need an engine to do this, and tbh I'd rather know how to do it myself. – user1154016 Mar 30 '12 at 10:45

1 Answers1

0

Do you also have created ldpi sprites?

wbb
  • 266
  • 1
  • 3