skip to Main Content

I’ve made a game with a player that looks like this:

enter image description here

I want to make him blink. For this, I’ve made, with photoshop, a few images that corresponds to the flutter:

enter image description here

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


  1. 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.

    Login or Signup to reply.
  2. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search