How to implement effect when SKSpriteNode is transparent but become visible with light?

109 views Asked by At

I would like to implement the effect when transparency of SKSpriteNode changes when it illuminated by light. By default SKSpriteNode is transparent but become visible with light.

1

There are 1 answers

2
sangony On

Your question is a bit vague on context.

You can either use a sprite's alpha channel or use a SKLightNode.

If you decide on the alpha channel, a possible implementation would be to change the alpha settings depending on proximity to the player.

If you use a SKLightNode, the node's light will illuminate the sprite dependent on a couple of settings. This implementation requires some trial and error.