本文介绍了在特定的帧开始AnimationDrawable?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我得到了一个AnimationDrawable像这样:
I got an AnimationDrawable like so:
AnimationDrawable ani = new AnimationDrawable();
ani.addFrame(first, duration);
ani.addFrame(second, duration);
ani.addFrame(third, duration);
ani.setOneShot(true);
和开始像这样:
ani.start();
我,想知道是否可以直接在开始可以说第二帧。是否有这样做的任何方法?我需要它的游戏,我希望能够恢复的确切帧时,我打我的暂停按钮呼叫:
I was wondering if it is possible to start directly, at lets say the second frame. Are there any ways of doing this? I need it for a game where I want to be able to resume the exact frame as when I hit my pause button calling:
ani.stop();
现在从暂停模式resumeing后重新开始整个动画。
For now it starts the entire animation again after resumeing from "pause mode".
推荐答案
在animtaion停止,使用此方法:ani.selectDrawable(指数);
When animtaion stop,use this method : ani.selectDrawable(index);
这篇关于在特定的帧开始AnimationDrawable?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!