Drawn and bitmaps

I am writing a game in real time for Android, and looking at some code from the samples presented in the SDK, I am confused when I have to use Bitmap or Drawable for my sprites in my game.

What's the difference? Which one is better (faster) for sprites, and which one is better for static background?

+12
android mobile android-bitmap android-drawable android-2.2-froyo
May 03 '11 at 23:38
source share
1 answer

To get an idea of โ€‹โ€‹which is better, you can watch this video:

http://www.youtube.com/watch?v=U4Bk5rmIpic

Interestingly, he was not a Java programmer, but an experienced game programmer and his approach can help you write tests to determine which is better.

For example, you may find that Bitmap better for a background image, if you really have a static background, but if you are going to change it programmatically, then you may have a problem.

However, there are other considerations besides speed, as you may find that memory, for example, will be a problem, and how many sprites you want on the screen at one time will be a problem.

+17
May 04 '11 at 12:21
source share



All Articles