2012-01-11 54 views
2

我正在使用andengine,并且我有一个动画Sprite。Android AndEngine向后动画

我使用scene.animate(duration,0,5,1)来将精灵从第一个贴图动画到最后一个。

我想知道,如果以某种方式我可以向后做动画,以便它从最后一个瓷砖开始到第一个瓷砖。
我需要得到的是0,1,2,3,4,5,4,3,2,1,0

+0

检查:HTTP://www.andengine.org/forums/tutorials/adding-a-view-above- a-game-t498.html – 2012-01-11 09:49:50

回答

4

试试这个,

sprite.animate(long[] pFrameDurations, int[] pFrames, int pLoopCount) 

其中 动画帧的细节

Parameters: 
    pFrameDurations: indicates the time delays between animations and must have the same length as pFrames. 
    pFrames: indices of the frames to animate. // Here you specify your 0,1,2,3,4,5,4,3,2,1,0 
    pLoopCount: indicates the no of times you want to repeat the animation 
+0

感谢这正是我需要的。 – Fofole 2012-01-11 10:39:26