小编Ste*_*fan的帖子

SKSpriteNode不会使用顺序Sprite Kit中的SKAction进行fadeInWithDuration

我按顺序运行3个SKActions,前两个运行正常,但fadeInWithDuration不会在节点中淡入,当视图加载时,节点会立即添加.我是否必须将节点的初始Alpha通道设置为0?有人可以解决问题吗?

- (void)setUpButtonStart
{
    SKSpriteNode *buttonStart = [SKSpriteNode spriteNodeWithImageNamed:@"start"];
    buttonStart.name = @"buttonStart";
    buttonStart.position = CGPointMake(900,50);
    [self addChild:buttonStart];

    SKAction *wait = [SKAction waitForDuration:2.5];
    SKAction *readIntro = [SKAction playSoundFileNamed:@"intro.mp3" waitForCompletion:NO];
    SKAction *fadeIn = [SKAction fadeInWithDuration:1.0];

    SKAction *sequence = [SKAction sequence:@[wait, readIntro, fadeIn]];

    [buttonStart runAction: sequence];
}
Run Code Online (Sandbox Code Playgroud)

xcode sprite-kit skaction

6
推荐指数
1
解决办法
8483
查看次数

标签 统计

skaction ×1

sprite-kit ×1

xcode ×1