-2

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.

Cesare
  • 9,139
  • 16
  • 78
  • 130
Daniil
  • 143
  • 3
  • 9
  • So, what's your specific problem? – Cesare Nov 25 '15 at 20:35
  • @Daniil You should update your question with a code that shows what you have tried so far. Also try to be more descriptive, or add a link to effect you are trying to achieve. Make it easier for people who answering :) – Whirlwind Nov 25 '15 at 20:41

1 Answers1

1

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.

sangony
  • 11,636
  • 4
  • 39
  • 55
  • I don't thing about first option, I will consider it. I actually interested in second one. In general when object is not illuminated it is black I want it to be transparent. When illuminated, the illuminated part become opaque. – Daniil Nov 25 '15 at 21:05
  • @Daniil - then you will have to manipulate the node's alpha setting. – sangony Nov 25 '15 at 21:57