0
votes

How can I have a white background and use SKEmitterNode in SpriteKit?

The emitter disappears if I set the background color of the SKScene. On the default black background I can see the red particles (when I comment out "backgroundColor = .white" in my SKScene). If I use a CAEmitterLayer then I can see the particles with a white background, but would like to use SKEmitterNode. I've spent a couple hours trying to find any reference to this problem.

Code is very simple -- adds child to SKScene

    if let particles = SKEmitterNode(fileNamed: "Sparks.sks") {
        particles.position = position
        scene.addChild(particles)
    }
1
Sorry, appears it is just something to do with the color white. Other color backgrounds will allow the emitters to show up, I just need to find the right color combinations. - Sam Hawksworth
Even worse... just had to change blend mode in editor - Sam Hawksworth
FWIW, if you prefer the look of the emitter particles with add mode, a trick is to leave the blend mode as add in the editor and then wrap the emitter in an SKEffectNode. The effect node can then be mixed into the rest of the scene with a different blend mode. - bg2b

1 Answers

0
votes

instead of the default .white, you may want to try setting the color with a color close to white... i.e. a UIColor where the RGB is .9,.9,.9