此代码中不运行操作:
SKAction *moveLeft = [SKAction moveToX:(-800) duration:0.6];
SKAction *moveRight = [SKAction moveToX:(800) duration:0.6];
[_labelLogo runAction:moveLeft];
[_labelPlay runAction:moveRight];
NewYork *start = [[NewYork alloc] initWithSize:self.size];
SKTransition *reveal = [SKTransition fadeWithColor:[UIColor clearColor] duration:2];
reveal.pausesIncomingScene = NO;
[self.scene.view presentScene: start transition: reveal];如果我评论NewYork切换,它们可以工作。
发布于 2014-03-26 15:33:19
动作问题*moveLeft / *moveRight,是因为立即开始向NewYork场景的转换,所以您应该等待*moveLeft / *moveRight完成如下操作:
SKAction *moveLeft = [SKAction moveToX:(-800) duration:0.6];
SKAction *moveRight = [SKAction moveToX:(800) duration:0.6];
[_labelLogo runAction:moveLeft];
[_labelPlay runAction:moveRight completion:^{
NewYork *start = [[NewYork alloc] initWithSize:self.size];
SKTransition *reveal = [SKTransition fadeWithColor:[UIColor clearColor] duration:2];
reveal.pausesIncomingScene = NO;
[self.view presentScene:start transition:reveal];
}];https://stackoverflow.com/questions/22664741
复制相似问题