in my game I have these neon barriers. I would like to know how to make a glowing effect around them as if they were lighting up. Here is the function where I create the obstacles:
func addObstacle (_ type:ObstacleType) -> SKSpriteNode {
let obstacle = SKSpriteNode(imageNamed: "neonLine2.png")
obstacle.color = UIColor.green
obstacle.size = CGSize(width: 0, height: 100)
//(color: UIColor.white, size: CGSize(width: 0, height: 30))
obstacle.name = "OBSTACLE"
obstacle.physicsBody?.isDynamic = true
switch type {
case .small:
obstacle.size.width = self.size.width * 0.2
break
case .medium:
obstacle.size.width = self.size.width * 0.35
break
case .large:
obstacle.size.width = self.size.width * 0.75
break
}
obstacle.position = CGPoint(x: 0, y: self.size.height + obstacle.size.height)
obstacle.physicsBody = SKPhysicsBody(rectangleOf: obstacle.size)
obstacle.color = UIColor(red: 0, green: 0.4314, blue: 0.7373, alpha: 1.0)
obstacle.colorBlendFactor = 1.0
obstacle.physicsBody?.categoryBitMask = CollisionBitMask.Obstacle
obstacle.physicsBody?.collisionBitMask = 0
return obstacle
}
In some other post I read that you can use a CIFilter? If so how can I utilize this feature.
Please let me know if there is anything I can try. Thanks!