Particle2D: SurfaceEmitter

Some demos of the new emitter type "SurfaceEmitter". The surface emitter has some useful options. You could decide if to emit from transparent areas or not(see the examples below) and best of all, you could set up a grid resolution parameter for the surface. Think about a large photo, there is not enough CPU-power to emit 20.000+ particles per second, so you have the possibility to create a grid of tiles from the surface.

See how you could change the grid.

Actionscript:
  1. myEmitter = new SurfaceEmitter(x, y, surface);
  2. myEmitter.gridResolution = 5;

If you have f.e. an image with a resolution of about 100x100 pixel, the emitter will render only 20x20 tiles. And for sure you have all the possibilities with the surface emitter that you have with the other emitter types(gravity, post effects, etc.). For difficult images you could also set the particle-concentration parameter to prevent performance issues. Last but not least, you could choose between color-matching on or off. And for sure, the surface emitter parameters are fully animateable.

This is the PNG-file i have used to emit from.
letter_p.png

SurfaceEmitter, 300pps, grid-resolution of 2, particle-concentration of 10, no emit from transperant areas
(Move your mouse over the app to start the emit-process)
[kml_flashembed movie="http://impossiblearts.com/projects/particle2d/Particles_1.swf" height="320" width="400" /]

SurfaceEmitter, 300pps, grid-resolution of 2, particle-concentration of 10, no emit from transperant areas
(Move your mouse over the app to start the emit-process)
[kml_flashembed movie="http://impossiblearts.com/projects/particle2d/Particles_2.swf" height="320" width="400" /]

Finally, here you can download the updated code base with a quick and dirty class documentation and a test file.

Ps.: I have to give a big credit to the developers of Tweener. It's a nice and easy-to-use tweening engine. All animations i have done for Particle2D are realized with this nice package.


About this entry