I have a SKSpriteNode
containing other SKSpriteNodes
. How can I create a copy of this SKSpriteNode
where all the pixels are black?
Once I have this shadow SKSpriteNode
I will then flip it upside down and use it as a shadow.
Thanks
You can create a shadow using the same image like this :
SKSpriteNode *shadow = [SKSpriteNode spriteNodeWithImageNamed:@"YourImageName"];
shadow.blendMode = SKBlendModeAlpha;
shadow.colorBlendFactor = 1;
shadow.color = [SKColor blackColor];
shadow.alpha = .25; // make shadow partly transparent
Then just position it however you like based on desired light direction. Alpha isn't needed if you want it to be solid black.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With