Вопрос

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