Packageorg.flintparticles.twoD.particles
Classpublic class Particle2DUtils
InheritanceParticle2DUtils Inheritance Object

Utility methods for working with two-d particles.



Public Methods
 MethodDefined By
  
createParticle2DFromDisplayObject(obj:DisplayObject, renderer:DisplayObject = null, factory:ParticleFactory = null):Particle2D
[static]
Particle2DUtils
  
createParticles2DFromDisplayObjects(displayObjects:Array, renderer:DisplayObject = null, factory:ParticleFactory = null):Vector.<Particle>
[static] Adds existing display objects as particles to the emitter.
Particle2DUtils
  
createPixelParticlesFromBitmapData(bitmapData:BitmapData, factory:ParticleFactory = null, offsetX:Number = 0, offsetY:Number = 0):Vector.<Particle>
[static]
Particle2DUtils
  
createRectangleParticlesFromBitmapData(bitmapData:BitmapData, size:uint, factory:ParticleFactory = null, offsetX:Number = 0, offsetY:Number = 0):Vector.<Particle>
[static]
Particle2DUtils
Method Detail
createParticle2DFromDisplayObject()method
public static function createParticle2DFromDisplayObject(obj:DisplayObject, renderer:DisplayObject = null, factory:ParticleFactory = null):Particle2D

Parameters

obj:DisplayObject
 
renderer:DisplayObject (default = null)
 
factory:ParticleFactory (default = null)

Returns
Particle2D
createParticles2DFromDisplayObjects()method 
public static function createParticles2DFromDisplayObjects(displayObjects:Array, renderer:DisplayObject = null, factory:ParticleFactory = null):Vector.<Particle>

Adds existing display objects as particles to the emitter. This allows you, for example, to take an existing image and subject it to the actions of the emitter.

This method moves all the display objects into the emitter's renderer, removing them from their current position within the display list. It will only work if a renderer has been defined for the emitter and the renderer has been added to the display list.

Parameters

displayObjects:Array — The display object whose coordinate system the display object's position is converted to. This is usually the renderer for the particle system created by the emitter.
 
renderer:DisplayObject (default = null) — Each parameter is another display object for adding to the emitter. If you pass an array as the parameter, each item in the array should be another display object for adding to the emitter.
 
factory:ParticleFactory (default = null)

Returns
Vector.<Particle>
createPixelParticlesFromBitmapData()method 
public static function createPixelParticlesFromBitmapData(bitmapData:BitmapData, factory:ParticleFactory = null, offsetX:Number = 0, offsetY:Number = 0):Vector.<Particle>

Parameters

bitmapData:BitmapData
 
factory:ParticleFactory (default = null)
 
offsetX:Number (default = 0)
 
offsetY:Number (default = 0)

Returns
Vector.<Particle>
createRectangleParticlesFromBitmapData()method 
public static function createRectangleParticlesFromBitmapData(bitmapData:BitmapData, size:uint, factory:ParticleFactory = null, offsetX:Number = 0, offsetY:Number = 0):Vector.<Particle>

Parameters

bitmapData:BitmapData
 
size:uint
 
factory:ParticleFactory (default = null)
 
offsetX:Number (default = 0)
 
offsetY:Number (default = 0)

Returns
Vector.<Particle>