All is in the question, I've worked enough with cocos2d to say it's a great library but today I only wanna use particle system in a total UIKit project. As long as I know, unfortunately, I have to implement one with OpenGL. Any suggestions ?
7 Answers
You can use Core Animation and CAReplicatorLayer to generate particle systems without having to drop down to OpenGL ES. Joe Ricioppo's "To 1e100f And Beyond with CAReplicatorLayer" gives an introduction to how to use this class. Also, Apple has their ReplicatorDemo sample application, which I ported to the iPad.
On the Mac, there's also the CAEmitterLayer, which became available in iOS as of 5.0. Apple's sample applications for this include Fire, which shows off fire and smoke effects, and Fireworks, which simulates a fireworks display.

- 170,088
- 45
- 397
- 571
-
Thanks a lot. As you said, unfortunately, CAEmitterLayer doesn't exist... Let's create a particle system emitter myself with CAReplicatorLayer =/ Cya – klefevre Jan 24 '11 at 22:00
-
1I want to update this post to guide new users. CAEmitterLayer now available in iOS. – fyasar May 28 '13 at 08:57
-
@fyasar - Good point. I've updated my answer to indicate that this is available in iOS 5.0+. – Brad Larson May 28 '13 at 22:42
For a UIKit-only project you could use Particle Playground (Mac App Store Link) to configure your emitter on your mac in a simulator and the export it as code ready for integration in your project. PP is quite similar to Particle Designer as mentioned by matt.
If you don't want to use a helper so you can dive deeper into the CAEmitter(Layer/Cell) then I would recommend reading this tutorial on Ray Wenderlich's site or this article on Arg! Team's blog. They have helped me a lot in configuring my own emitters.
Full disclosure: I am the developer of Particle Playground. I grew tired of the whole tweak-recompile-observe-loop and developed PP in my spare time.

- 7,281
- 4
- 39
- 58

- 426
- 4
- 9
Note that CAEmitterLayer was added in iOS 5. That makes particle effects much easier.
I haven't used it yet, but I have seen examples that do. I'm not sure how hard Apple's fire sample would be to port to iOS 5. I might just give it a try

- 128,072
- 22
- 173
- 272
I too, find designing particles in UIKit a challenge so I created an app for it. Used it to create various particles in my games now. So easy! It is a iDevice app so you can play with particles while in a bus or at a mall and immediately export out the codes.
If anybody is interested: http://iapps.emirbytes.com/particlex/index.html

- 7,545
- 8
- 50
- 85
In UIKit you build particle systems by using the QuartzCore framework. For a complete example read this post:
http://www.raywenderlich.com/6063/uikit-particle-systems-in-ios-5-tutorial

- 87,323
- 22
- 191
- 272

- 6,377
- 9
- 45
- 73
You should use CAEmitterLayer
Here are some tutorials
- https://www.hackingwithswift.com/read/37/5/creating-a-particle-system-using-caemitterlayer
- https://medium.com/call-voicy/comets-animating-particles-in-swift-3431a7f1b250
Here are some ways to playground it
- Here is how to playground using SpriteKit http://www.techotopia.com/index.php/An_iOS_8_Sprite_Kit_Particle_Emitter_Tutorial
- Xcode 8+ also includes Playground, you can create a Playground to play around with it https://github.com/onmyway133/ParticlePlayground

- 45,645
- 31
- 257
- 263
You should also consider Particle Emitter (http://particledesigner.71squared.com/) which was designed to be used as a cocos2d plug-in.
A tutorial is provided here: http://www.71squared.com/2009/05/iphone-game-programming-tutorial-8-particle-emitter/

- 693
- 9
- 16
-
The question was about an UIKit project, not Cocos2D. Plz read the question before answer anything. – klefevre Mar 01 '13 at 09:31