Here is my setup using the Sprite Kit. First, I create a simple node sprite inside SKScene, for example:
let block = SKSpriteNode(color: UIColor.redColor(), size: CGSizeMake(90, 160)) block.zPosition = 2 block.shadowCastBitMask = 1 addChild(block)
Then add the light node to the scene:
let light = SKLightNode() light.categoryBitMask = 1 light.falloff = 1 addChild(light)
Of course, the block now highlights a nice little shadow:

Now I am fading the block by manipulating its alpha value, for example, by running an action:
let fadeOut = SKAction.fadeAlphaTo(0.0, duration: 5.0) block.runAction(fadeOut)
Here's an awkward situation: while the block is becoming more transparent, the shadow remains exactly the same . Here's what it looks like just a minute before the end of the action:

And as soon as the alpha drops to 0.0 entirely, the shadow suddenly disappears, from one frame to another.
It would be much nicer if the shadow slowly became weaker and weaker, since the object casting it becomes more and more transparent .
Question:
Is this possible with the Sprite Kit? If so, how would you do it?
Gamma source share