temp
temp

Reputation: 649

SKLabelNode fade out in sprite scene

I have an SKLabelNode that I am adding to my scene. I want it to fade out in 3 seconds and so it isn't visible anymore. How would I achieve this effect?

Upvotes: 2

Views: 1021

Answers (1)

jervine10
jervine10

Reputation: 3077

You can run an action:

[self.labelNode runAction:[SKAction fadeAlphaTo:0.0 duration:3.0] completion:^{
   [self.labelNode removeFromParent];
}]

You can leave off the completion block if you don't want to remove it from the scene when you're done.

Upvotes: 4

Related Questions