I’ve made a game with a player that looks like this:
I want to make him blink. For this, I’ve made, with photoshop, a few images that corresponds to the flutter:
Depending on the time, I draw an image or I draw another one, but this takes a lot of memory and makes my app go slow, any alternative to this method? Thanks in advance !
2
Answers
Try to create a unique image containing all the animation states.
It is more expensive to open and modify several small files than one big file.
Depending on task it exist few solutions.
1) AnimationDrawable you could just add few your drawable resources. Then you will be able to use this Drawable with ImageView, ProgresBar, etc.
2) If you really want to use SurfaceView, you could merge your res into one mipmap file, and then draw different parts of this mipmap.
3) Performance solution. you could use your mipmap as texture on gl es scene. There is a lot topics about it.