Tuesday Discount - Lifetime Access for $20!!!! - Click Here!

Particle Emitters – Story Tellers iOS Starter Kit Documentation

Using particle emitters, or  is incredibly simple in the Story Tellers iOS Starter Kit 2. You can drag an Emitter into your scene, Name it, and treat it like any other node.

Adding an SKEmitterNodes to your SKScene

 

After naming it, you can use Properties to stick the emitter to other nodes, run actions on it, hide / show it, etc. If you want to customize your own particle emitter, you can set the Particle Texture to any image, then begin defining how the particles are emitted using Birthrate, Maximum, Lifetime, etc. You’ll notice in the screenshot above, there’s no shortage of options. And customizing these can take a lot of trial and error. So we have a solution….

If you create a new file in Xcode you can choose SpriteKit Particle File, then choose from a pulldown of pre-made particles. 

Using pre-made Particle files in place of SKEmitterNodes in SKScene

Give your particle file a name, for example, Magic.sks. 

Next, go back to your Scene file and give your emitter the same name (minus .sks). So for example, Magic.

Replacing pre-made Particle files in place of SKEmitterNodes in SKScene

The code will notice this match and replace the emitter in your scene with the preset emitter in Magic.sks

You can modify any of the settings in the .sks file and they’ll be used in the Scene.

And since the placeholder emitter in the Scene defaulted to have 0 values for most options, if you set those to anything other than 0 the kit will use those values.

So your .sks file is essentially a base template, and the placeholder emitter can override the template.

Cool huh! 

 




Know what an affiliate program is? You make money just by sharing links to our site! Win. Win.

Earn when you refer any buyer here! 30 day tracking. Commissions are 33%-50% and recur on subscription products!