| Package | com.desuade.partigen.emitters |
| Class | public dynamic class Emitter |
| Inheritance | Emitter BasicEmitter flash.display.Sprite |
| Subclasses | IDEEmitter |
| Language Version : | ActionScript 3 |
| Since : | 08.05.2009 |
| Runtime Versions : | AIR 1.0, Flash Player 9.0.0 |
| Property | Defined By | ||
|---|---|---|---|
![]() | active : Boolean [read-only]
This is true if the emitter is currently emitting. | BasicEmitter | |
| angle : int = 0
This is the angle used by ParticlePhysicsControllers on new particles. | Emitter | ||
| angleSpread : * = 0
This is the spread for the angle, to create a random range for ParticlePhysicsControllers. | Emitter | ||
![]() | burst : int = 1
This is the amount of particles to be created on each emission. | BasicEmitter | |
![]() | cacheParticleAsBitmap : Boolean = false
This will set "cacheAsBitmap = true" on all created particles.
Test using this vs groupBitmap - as performance will vary based on each effect.
Also test this with BitmapRenderer, as it may vary the effect and performance.
| BasicEmitter | |
| controllers : Object
This object holds the EmitterController and the ParticleController.
They are accessible as follows: controllers.emitter and controllers.particle
These controllers are what is used to configure particles and the way the behave, as well as properties for the emitter itself.
| Emitter | ||
![]() | enableEvents : Boolean = false
Enable particle BORN and DIED events. | BasicEmitter | |
![]() | eps : Number
This stands for "emissions per second". | BasicEmitter | |
![]() | forceVariety : Boolean = false
This forces pooled particles to rebuild their groups and controllers to eliminate any possible repetition or error at the cost of performance.
Set this to true if you plan on making changes to the emitter while it's running. | BasicEmitter | |
![]() | groupAmount : int = 1
This controls how may particles are made in a "particle group". | BasicEmitter | |
![]() | groupBitmap : Boolean = false
This will create a new Bitmap object for the particle instead of the direct display object. | BasicEmitter | |
![]() | groupProximity : int = 0
This determines the maximum distance away from the center of the group to create new particles. | BasicEmitter | |
![]() | id : int [read-only]
The unique id of the emitter. | BasicEmitter | |
![]() | life : Number = 1
This is the duration in seconds a particle will exist for.
If the value is 0, the particle will live forever.
| BasicEmitter | |
![]() | lifeSpread : * = 0
This is the spread for particle lives. | BasicEmitter | |
![]() | particle : Class
This is the class used to create new particles from. | BasicEmitter | |
![]() | particleBaseClass : Class
This is the base class to used for all created particles.
When the pools create particle objects, they use this. | BasicEmitter | |
![]() | particleBlendMode : String = normal
This defines the blendmode for each particle created.
Choices: "add", "alpha", "darken", "difference", "erase", "hardlight", "invert", "layer", "lighten", "multiply", "normal", "overlay", "screen", "subtract"
Note: PixelRenderer will assume the blendmode of all particles/pixels is the same.
| BasicEmitter | |
![]() | particleFilters : Array
This is an array of filters that gets applied to each particle as it's born. | BasicEmitter | |
![]() | pool : Pool
This is the Pool to use to store and manage the actual particle objects. | BasicEmitter | |
![]() | renderer : Renderer
The Renderer to use for created particles. | BasicEmitter | |
| Method | Defined By | ||
|---|---|---|---|
Emitter()
This creates a new Emitter.
This is the standard, full-featured emitter that's recommended to use. | Emitter | ||
![]() | createParticleBitmap(padding:int = 0):void
This creates the main bitmapdata object used when groupBitmap == true. | BasicEmitter | |
![]() | emit(burst:int = 1):void
This method creates new particles each time it's called. | BasicEmitter | |
fromXML(xml:XML, reset:Boolean = true, renderer:Boolean = false):* [override]
This configures the emitter based on the XML, and adds any controllers (if available)
| Emitter | ||
![]() | getPrefetchLifeArray(time:Number):Array
This creates an array of particle's life values, both original and current, based on the eps/burst and supplied time value as it would if the emitter was running for the time duration. | BasicEmitter | |
![]() | killParticles():void
This kills all currently existing particles in the pool created by this emitter
| BasicEmitter | |
![]() | prefetch(time:Number):void
This prefetches (and creates) the particles that would have existed if the emitter was running for the given time. | BasicEmitter | |
reset():void [override]
This resets the emitter to the defaults and purges the pool
| Emitter | ||
start(time:Number = 0, startcontrollers:Boolean = true):void [override]
Starts the emitter. | Emitter | ||
stop(stopcontrollers:Boolean = true):void [override]
This stops the emitter. | Emitter | ||
toXML():XML [override]
This generates an XML object representing the entire emitter
| Emitter | ||
| Method | Defined By | ||
|---|---|---|---|
createParticle(totalLife:Number = 0, remainingLife:Number = 0):IBasicParticle [override]
| Emitter | ||
| angle | property |
public var angle:int = 0
This is the angle used by ParticlePhysicsControllers on new particles. This only effects properties that are using physics, NOT ParticleTweenControllers.
The default value is 0, which is pointing "right". 90 is "up", 180 is "left", and 270 is "down".
| angleSpread | property |
public var angleSpread:* = 0This is the spread for the angle, to create a random range for ParticlePhysicsControllers.
| controllers | property |
public var controllers:Object
This object holds the EmitterController and the ParticleController.
They are accessible as follows: controllers.emitter and controllers.particle
These controllers are what is used to configure particles and the way the behave, as well as properties for the emitter itself.
| Emitter | () | Constructor |
public function Emitter()
This creates a new Emitter.
This is the standard, full-featured emitter that's recommended to use. It offers an innovative and extremely powerful way to configure particle effects, based on MotionControllers from the Motion Package.
An emitter is the object that controls the creation of new particles, rather than calling new Particle() directly, using emitters makes creating particle effects easy.
Particles are (generally) spawned from the current location of the emitter, unless specifically overridden by x,y,z controller start values.
The management of the actual particle objects are handled by Pools, and how they are displayed on screen by Renderers. Both can be shared by multiple emitters.
| createParticle | () | method |
override protected function createParticle(totalLife:Number = 0, remainingLife:Number = 0):IBasicParticle
Parameters
totalLife:Number (default = 0) | |
remainingLife:Number (default = 0) |
IBasicParticle |
| fromXML | () | method |
override public function fromXML(xml:XML, reset:Boolean = true, renderer:Boolean = false):*This configures the emitter based on the XML, and adds any controllers (if available)
Parameters
xml:XML — The XML object to use to configure the emitter
| |
reset:Boolean (default = true) — Resets the emitter before applying XML and also purges the pool
| |
renderer:Boolean (default = false) — If true, this creates (and overwrites) the emitter's renderer with one from XML. If this is a BitmapRenderer, be sure to call resize(width, height) on it after the XML. Also, for BasicEmitters only (to save file size), you must create a reference to the Renderers you're going to use before using it through XML (for Flash to include the classes). This can be done easily as var renderers:Array = [NullRenderer, StandardRenderer, BitmapRenderer]; (this is done already for the Emitter and IDEEmitter classes).
|
* — The emitter object (for chaining)
|
| reset | () | method |
override public function reset():voidThis resets the emitter to the defaults and purges the pool
| start | () | method |
override public function start(time:Number = 0, startcontrollers:Boolean = true):void
Starts the emitter. Passing a time will 'prefetch' particles as if the emitter had already been running for the given amount of time. If you only want to emit once, or at your own rate, use emit()
It also, by default, starts all the controllers managed by the EmitterController.
Parameters
time:Number (default = 0) — Starts the emitter as if it's already been running for this duration (in seconds).
| |
startcontrollers:Boolean (default = true) — This starts all MotionControllers managed by the EmitterController.
|
| stop | () | method |
override public function stop(stopcontrollers:Boolean = true):voidThis stops the emitter. It also, by default, stops all the controllers managed by the EmitterController.
Parameters
stopcontrollers:Boolean (default = true) — This stops all MotionControllers managed by the EmitterController.
|
| toXML | () | method |
override public function toXML():XMLThis generates an XML object representing the entire emitter
ReturnsXML — An XML object representing the emitter
|