skeffectnode

How can you create a glow around a sprite via SKEffectNode

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-26 22:34:27
问题 I have a SKSpriteNode that I'd like to have a blue glow around it's edges for highlighting purposes. I am guessing that I would need to make my sprite a child of a SKEffectNode and then create/apply a filter of some sort. UPDATE : I have investigated this quite a it with the chosen answer's approach, and discovered that SKEffectNode has a sizeable hit on performance even if you have it set to shouldRasterize and 'no filter' defined. My conclusion is that if your game requires more than 10

Add glowing effect to an SKSpriteNode

一个人想着一个人 提交于 2019-11-26 15:38:47
问题 I have a moving black image on a dark screen, to make it easier to see I would like to add in a white glow to the image. This is my code for the moving image: Ghost = SKSpriteNode(imageNamed: "Ghost1") Ghost.size = CGSize(width: 50, height: 50) Ghost.position = CGPoint(x: self.frame.width / 2 - Ghost.frame.width, y: self.frame.height / 2) Ghost.physicsBody = SKPhysicsBody(circleOfRadius: Ghost.frame.height / 1.4) Ghost.physicsBody?.categoryBitMask = PhysicsCatagory.Ghost Ghost.physicsBody?