Android AndEngine animate backwards
Pergunta
I am using andengine and I have an animated Sprite.
I use scene.animate(duration,0,5,1)
to animate the sprite from first tile to the last.
I am wondering if somehow I could do the animation backwards so that it starts from the last tile to the first tile.
What I need to get is 0,1,2,3,4,5,4,3,2,1,0
.
Solução
Try this,
sprite.animate(long[] pFrameDurations, int[] pFrames, int pLoopCount)
where Animate specifics frames
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
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow