user3138007
user3138007

Reputation: 637

SKLightNode: Changing alpha of ambientColor

Is there a way to change the alpha value of an SKLightNodes ambientColor so that e.g. their background can be seen even if the lightNode is on the other side of the screen?

//Add LightNode
let lightNode = SKLightNode()
lightNode.ambientColor = UIColor.blackColor()
lightNode.lightColor = UIColor.whiteColor()
lightNode.shadowColor = UIColor.blackColor()
lightNode.categoryBitMask = LightCategory.Light1.rawValue
lightNode.enabled = true
lightNode.falloff = 0.05
self.addChild(lightNode)

//Sprite
sprite.lightingBitMask = LightCategory.Light1.rawValue

Upvotes: 0

Views: 432

Answers (1)

septicorn
septicorn

Reputation: 142

It says here in the SKLightNode Class Reference that, "The alpha value of the color is ignored." If you want things on the other end of the screen to be visible, you should change the falloff.

Upvotes: 1

Related Questions