简体   繁体   中英

Different screen sizes for android

I am designing an android game, and have so far test it only on a 480 x 800 pixel emulator, obviously this isn't suitable for all phones. I completely understand with layouts and xml and drawables the need to create them in different sizes, but what about when it comes to canvas methods such as drawing bitmaps, because they would be drawn in different positions on different size screens etc

Thanks in advance

Ben

Personally I dont use different size images for different phones, my images are scales up/down depending on the phone but I make sure the resolution looks good on all phones.

It depends how you have coded really, best way to find out is to scale some of your objects and try it on a different emulator. If its all messed up you will need to make changes.

Have you made the game by pure points such as x = 200, y = 200 of have you done something like x = screenLength/3, y = screenHeight/10?

The problem isn't just the number of pixels, but also how many pixels are in an inch. That's why Android uses " density independence pixels ". If you follow Android's dpi conventions and allow it to fit bitmaps for you, you'll find that scaling, positioning, etc. becomes automatic.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM