我试图为标签生成一个动作,这是一个精灵的属性。
这就是我正在尝试的,但标签没有移动,我无法确定它们不移动的原因。
- (void) spriteLabelMoveFinished:(id)sender
{
CCLOG(@"AnimateLabel Move Finished");
Sprites *sprite = (Sprites *)sender;
CCLOG(@"LabelFinalPosition: %f,%f",sprite.spriteLabel.position.x,sprite.spriteLabel.position.y);
[self animateSpriteLabel:sprite.spriteLabel];
}
-(void)animateSpriteLabel:(Sprites *)sprite
{
CCLOG(@"We're animating the SpriteLabel");
CCLabelTTF *spriteLabel = nil;
spriteLabel = sprite.spriteLabel;
int actualDuration = spriteLabelSpeed; // Another Property, inside the .m
// Create the actions
CCLOG(@"AnimatingLabel LabelPosition: %f,%f",spriteLabel.position.x,spriteLabel.position.y);
id actionMove = [CCMoveBy actionWithDuration:actualDuration
position:ccpMult(ccpNormalize(ccpSub(_player.position,spriteLabel.position)), 10)];
id actionMoveDone = [CCCallFuncN actionWithTarget:self
selector:@selector(spriteLabelMoveFinished:)];
[sprite runAction:
[CCSequence actions:actionMove, actionMoveDone, nil]];
}
标签只是出现并没有移动....感谢您的帮助和时间,祝您好运!