I just wanted to do something that for me seems very simple, which makes the emitter look at the whole background of the presentation ... then I would like the view to have a Fill aspect, scale, etc., which allows the emitter to look right no matter what i do ...
I do not want to just scale the emitter. I want the objects to remain in the correct size, but I want the emitter area to change ... think of it as a βcanvas sizeβ (no resizing) in Photoshop.
I would use this effect, for example, to add snow or rain to the whole scene or to create a snow globe sprite ...
The thing, maybe I'm just not looking in the right place, but it seems that any size properties on SKEmitterNode are read only ... what am I doing wrong?
here is some code where the resulting emitter is a small rectangle in the middle of the view.
override func viewDidLoad() { super.viewDidLoad() if let scene = GameScene(fileNamed:"GameScene") { // Configure the view. let skView = self.view as! SKView skView.showsFPS = true skView.showsNodeCount = true if let emitter = SKEmitterNode(fileNamed: "Bokeh") { emitter.position = view.center scene.addChild(emitter) } /* Sprite Kit applies additional optimizations to improve rendering performance */ skView.ignoresSiblingOrder = true /* Set the scale mode to scale to fit the window */ scene.scaleMode = .AspectFill skView.presentScene(scene) } }
I need to clarify a little more. For snow, I would like particles to create an instance before they entered the scene, and then fall through the stage and die only after they left the scene, and not randomly appear throughout the scene, and then continued to fall .. I would like the snow to occupy all the boundaries of the scene.
source share