How to change the opacity of spritenode

I work with 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 do not find how, other than using SKAction such as FadeIn, FadeOut, etc.

I tried to change red.colorBlendFactor, but only changed the opacity of the new color to node and not to node opacity ...

+4
source share
1 answer

Use property SKNode alpha:

red.alpha = 0.5  // set red to 50% transparent
+11
source

All Articles