开发者

How to draw a frame by frame Animation from frame x to frame y

开发者 https://www.devze.com 2023-02-10 04:36 出处:网络
I want to know if there is any solution available in Android that will allow me to define an Animation by entering a set of frames to it (images), And then allow me to play from frame number x to y.

I want to know if there is any solution available in Android that will allow me to define an Animation by entering a set of frames to it (images), And then allow me to play from frame number x to y.

I'm currently using AnimationDrawable for frame by frame animations and it seems to lack th开发者_StackOverflow社区at functionality.

Is there maybe a different Class that could help me here?

Thanks a lot!

Ita


You can add frames x through y to a new AnimationDrawable using addFrame(Drawable frame, int duration). Since you mentioned images, you should use a BitmapDrawable to load your images and then pass it to the AnimationDrawable along with the duration.

0

精彩评论

暂无评论...
验证码 换一张
取 消