7

I'm working using XCode 6, Sprite Kit and Swift and I have a node with this declaration:

var red = SKSpriteNode(imageNamed: "Rectangle")

and I want to change the opacity of the node, but I don't find how, except using a SKAction like FadeIn, FadeOut etc...

I tried changing red.colorBlendFactor but it's only change the opacity of a new color on the node, not the node's opacity...

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Drakalex
  • 1,488
  • 3
  • 19
  • 39

1 Answers1

16

Use SKNode's alpha property:

red.alpha = 0.5  // set red to 50% transparent
vacawama
  • 150,663
  • 30
  • 266
  • 294