Alex
Alex

Reputation: 1232

Should individual images, or a sheet of images be used for games? - beginner

Experimenting with android game development. I'm using PNG format for images, and was wondering if I should use a sheet with multiple images, know their offsets, etc. and use it like that. Or if I should have a single file per image. And if png isn't a good format to use, please let me know.

Upvotes: 1

Views: 244

Answers (1)

msigman
msigman

Reputation: 4524

You should use separate images.

You can't use sprites in the same way on Android you can with HTML. And there isn't a space constraint like in the old days of video game programming.

There are reasons why web pages use sprites, and it's not because they're easier - it's because it speeds up webpages because you don't have to make multiple HTTP requests. Since the images will already be in your release APK, you don't gain anything by spriting them.

Not only that, but you're doing some harm by spriting on Android: Memory constraints on some Android phones are much lower than you might expect. If the entirety of your graphics are in memory at any given time, that lowers the amount of memory you have for everything else.

Plus, sprites will be harder to handle once you start writing for different screen densities (ldpi, mdpi, hdpi).

Using image sprites on android

Upvotes: 1

Related Questions