0

このコードではアクションは実行されません。

 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スイッチングにコメントすると、それらは機能します。

4

1 に答える 1

3

アクション *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];
 }];
于 2014-03-26T15:33:19.400 に答える