1
你知道動畫是如何從靜止幀中反轉的嗎?。如何從剛剛停止的幀開始反轉動畫?
EX>動畫幀是1 - > 2 - > 3 - > 4 - > 5
如果我觸摸在3幀然後進行動畫1 - > 2 - > 3 - > 2 - > 1
如果我觸摸4幀然後動畫1 - > 2 - > 3 - > 4 - > 3 - > 2 - > 1
mh ...有沒有辦法使用CCAnimate類?
你知道動畫是如何從靜止幀中反轉的嗎?。如何從剛剛停止的幀開始反轉動畫?
EX>動畫幀是1 - > 2 - > 3 - > 4 - > 5
如果我觸摸在3幀然後進行動畫1 - > 2 - > 3 - > 2 - > 1
如果我觸摸4幀然後動畫1 - > 2 - > 3 - > 4 - > 3 - > 2 - > 1
mh ...有沒有辦法使用CCAnimate類?
你可以嘗試這樣的事:
- (void)ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
//Here "numbers" is your Animation Sprite
//Get display frame of the sprite
CCSpriteFrame *currentFrame = [numbers displayFrame];
GLuint index = currentFrame.texture.name;
//Use this index to determine current frame's index
//Beware!!! As I know it will not return a zero based index, so check it out with an output
/*
NEXT :
- Now you know the current frame index, let's say it is 3
- Re-order your spriteFrames like 3->2->1 (You have new spriteFrames array)
- CCAnimation with this spriteFrames array
- CCAction with this CCAnimation
- Run the Action!!! There, your reversed animation.
*/
}