I'm adding a simple emitter node this way:
class ViewController: UIViewController {
override func viewWillAppear(_ animated: Bool) {
self.addParticles()
}
func addParticles() {
if let emitterNode = SKEmitterNode(fileNamed: "particles.sks") {
let skView = SKView(frame: UIScreen.main.bounds)
skView.backgroundColor = .clear
let scene = SKScene(size: UIScreen.main.bounds.size)
scene.backgroundColor = .clear
skView.presentScene(scene)
skView.isUserInteractionEnabled = false
scene.anchorPoint = CGPoint(x: 0.5, y: 0.5)
scene.addChild(emitterNode)
emitterNode.position.y = scene.frame.maxY
emitterNode.particlePositionRange.dx = scene.frame.width
self.view.addSubview(skView)
}
}
}
I want the particles to fill the whole screen, and to do so I'm using UIScreen.main.bounds
as the particles size. But by doing this, here is the result that I'm getting :
So for some reason, the particles only fills the top half of the screen, and I don't understand why. Could you help me understanding this?
Thank you very much