문제

Actions don't run in this code:

 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];

If i comment NewYork switching they work.

도움이 되었습니까?

해결책

the problem to action *moveLeft / *moveRight, its because start immediately the transition to NewYork scene, so you should wait that *moveLeft / *moveRight is finished like this:

 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];
 }];
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top