Packageorg.flintparticles.common.particles
Classpublic class Particle
InheritanceParticle Inheritance Object
Subclasses Particle2D

The Particle class is a set of public properties shared by all particles. It is deliberately lightweight, with only one method. The Initializers and Actions modify these properties directly. This means that the same particles can be used in many different emitters, allowing Particle objects to be reused. Particles are usually created by the ParticleCreator class. This class just simplifies the reuse of Particle objects which speeds up the application.



Public Properties
 PropertyDefined By
  age : Number = 0
The age of the particle, in seconds.
Particle
  alpha : Number
[read-only]
Particle
  collisionRadius : Number = 1
The radius of the particle, for collision approximation
Particle
  color : uint = 0xFFFFFFFF
The 32bit ARGB color of the particle.
Particle
  colorTransform : ColorTransform
[read-only] A ColorTransform object that converts white to the colour of the particle.
Particle
  dictionary : Dictionary
[read-only] The dictionary object enables actions and activities to add additional properties to the particle.
Particle
  energy : Number = 1
The energy of the particle.
Particle
  image : * = null
The object used to display the image.
Particle
  isDead : Boolean = false
Whether the particle is dead and should be removed from the stage.
Particle
  lifetime : Number = 0
The lifetime of the particle, in seconds.
Particle
  mass : Number = 1
The mass of the particle ( 1 is the default ).
Particle
  scale : Number = 1
The scale of the particle ( 1 is normal size ).
Particle
Public Methods
 MethodDefined By
  
Creates a particle.
Particle
  
Creates a new particle with all the same properties as this one.
Particle
  
initialize():void
Sets the particle's properties to their default values.
Particle
  
revive():void
Particle
Property Detail
ageproperty
public var age:Number = 0

The age of the particle, in seconds.

alphaproperty 
alpha:Number  [read-only]


Implementation
    public function get alpha():Number
collisionRadiusproperty 
public var collisionRadius:Number = 1

The radius of the particle, for collision approximation

colorproperty 
public var color:uint = 0xFFFFFFFF

The 32bit ARGB color of the particle. The initial value is 0xFFFFFFFF (white).

colorTransformproperty 
colorTransform:ColorTransform  [read-only]

A ColorTransform object that converts white to the colour of the particle.


Implementation
    public function get colorTransform():ColorTransform
dictionaryproperty 
dictionary:Dictionary  [read-only]

The dictionary object enables actions and activities to add additional properties to the particle. Any object adding properties to the particle should use a reference to itself as the dictionary key, thus ensuring it doesn't clash with other object's properties. If multiple properties are needed, the dictionary value can be an object with a number of properties.


Implementation
    public function get dictionary():Dictionary
energyproperty 
public var energy:Number = 1

The energy of the particle.

imageproperty 
public var image:* = null

The object used to display the image. In a 2D particle, this is usually a DisplayObject. In a 3D particle, this may be a DisplayObject, for displaying on a billboard or similar, or a 3D object in the form used by the render system.

isDeadproperty 
public var isDead:Boolean = false

Whether the particle is dead and should be removed from the stage.

lifetimeproperty 
public var lifetime:Number = 0

The lifetime of the particle, in seconds.

massproperty 
public var mass:Number = 1

The mass of the particle ( 1 is the default ).

scaleproperty 
public var scale:Number = 1

The scale of the particle ( 1 is normal size ).

Constructor Detail
Particle()Constructor
public function Particle()

Creates a particle. Alternatively particles can be reused by using the ParticleCreator to create and manage them. Usually the emitter will create the particles and the user doesn't need to create them.

Method Detail
clone()method
public function clone(factory:ParticleFactory = null):Particle

Creates a new particle with all the same properties as this one.

Note that the new particle will use the same image object as the one you're cloning. This is fine if the particles are used with a Bitmaprenderer, but if they are used with a DisplayObjectRenderer you will need to replace teh image property with a new image, otherwise only one of the particles (original or clone) will be displayed.

Parameters

factory:ParticleFactory (default = null)

Returns
Particle
initialize()method 
public function initialize():void

Sets the particle's properties to their default values.

revive()method 
public function revive():void