SKScene的UIView动画

时间:2014-03-22 02:26:34

标签: objective-c sprite-kit

UIView动画不在SKScene工作

MyScene.h

@property (nonatomic) SKLabelNode *tutorialLabel;

MyScene.m

- (IBAction)hideLabel:(id)sender {
    [UIView animateWithDuration:1 animations:^(void) {
        [_tutorialLabel setAlpha:0.0];
    }];
}

是否有更好的方法来隐藏SKLabelNode

1 个答案:

答案 0 :(得分:3)

如果您想淡出标签,可以使用SKActions:

- (IBAction)hideLabel:(id)sender {
    [_tutorialLabel runAction:[SKAction fadeOutWithDuration:1.0f]];
}