我有一个正在接受位置动画的 CCSprite。它的动画效果很好。在某个时间点,在开始动画和到达最终位置之间,我想获得 CCSprite 的确切位置
我知道 sprite.position 将返回最终位置
这是动画代码:
sprite = [CCSprite spriteWithFile:@"sprite.png"];
[sprite setPosition:ccp(winSize.width/2, 170)];
[self addChild:sprite];
CCMoveTo *moveSpriteUp = [CCMoveTo actionWithDuration:2.0 position:ccp(winSize.width/2, 210)];
CCEaseOut *upEase = [CCEaseOut actionWithAction:moveSpriteUp rate:2];
CCMoveTo *moveSpriteDown = [CCMoveTo actionWithDuration:2.0 position:ccp(winSize.width/2, 170)];
CCEaseOut *downEase = [CCEaseOut actionWithAction:moveSpriteDown rate:2];
CCSequence * spriteMoveSeq = [CCSequence actions:upEase, downEase, nil];
CCRepeatForever *spriteRepeat = [CCRepeatForever actionWithAction:spriteMoveSeq];
[sprite runAction:spriteRepeat];
//1 or 1.x seconds later, the sprite's Y postion will be somewhere between 170 and 210, this is what I want to catch
我有什么办法可以做到这一点?