3

I've reading Apple's guide to the Particle Emitter Editor to help me understand some of the concepts behind Particle Systems in iOS 5. I'm adding my particle emitter programmatically not using the Particle Emitter Editor and I'm using CAEmitterCell and CAEmitterLayer as I thought this would give me more or less the same type of particle systems as available with SpriteKit.

It was only when I wanted to experiment a bit with Blend modes (page 17 of the guide) that I realised that there doesn't seem to be a way of doing this wit CAEmitterCell — the 'particleBlendMode' is defined in the SKEmitterNode class and I can't see if in the CAEmitterCell class.

So that's my question: if working programmatically, does SKEmitterNode provide more possibilities than CAEmitterCell — or is it possible to create a similar effect to something like blend mode with CAEmitterCell? And if it isn't possible, are there any other things possible with SKEmitterNode that aren't possible with CAEmitterCell?

Many thanks.

DipakSonara
  • 2,598
  • 3
  • 29
  • 34
pingin
  • 482
  • 1
  • 6
  • 19

1 Answers1

1

It's not about what's possible and what isn't, it's more about what belongs together. If you make a Sprite Kit application you better stick to using SKEmitterNode for the sole reason that only those nodes work well together with other Sprite Kit nodes and scenes.

For instance if you present another scene with a transition, any non-Sprite Kit views like emitter cells will not partake in the transition animation. Moreover you can only render non-Sprite Kit views on top of the entire Sprite Kit scene. So if you wanted to have other sprites on top of a CAEmitterCell it would simply impossible to do that.

Therefore in Sprite Kit apps use SKEmitterNode regardless of features.

CodeSmile
  • 64,284
  • 20
  • 132
  • 217
  • 2
    Thanks that is helpful. If I was starting my app again I would probably use Sprite Kit. But given thst my app is not Sprite Kit, is there any advantage or reason for using CAEmitterCells versus SKEmitterNode (assuming I can use that class in my app)? Does one provide more powerful rendering options or better performance? And assuming I want to stick with CAEmitterCell, is something like blendingMode even possible? – pingin May 30 '14 at 14:28
  • 1
    If you do not use Sprite Kit you can't use SKEmitterNode. It's as simple as that. – CodeSmile May 30 '14 at 14:55
  • 1
    Thanks. Where I'm coming from is this question: http://stackoverflow.com/questions/19620866/how-to-add-particle-effects-to-an-ios-app-that-is-not-a-game-using-ios-7-spritek and I'm following the last suggestion (You can add SKView as a subview within your UIKit hierarchy… but In the end, if all you need is an emitter, it may be easier to create a CAEmitterLayer and add that as a sublayer to your UIView instead.) I suppose I just have to try both options and discover the differences between the two particle system implementations. – pingin May 31 '14 at 13:39