Packageorg.flintparticles.particles
Classpublic class Particle

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
  angVelocity : Number = 0
The angular velocity of the particle in radians per second.
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 : DisplayObject = null
The DisplayObject 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
  matrixTransform : Matrix
[read-only] A transformation matrix for the position, scale and rotation of the particle.
Particle
  rotation : Number = 0
The rotation of the particle in radians.
Particle
  scale : Number = 1
The scale of the particle ( 1 is normal size ).
Particle
  spaceSortX : uint
The position in the emitter's horizontal spacial sorted array
Particle
  velX : Number = 0
The x coordinate of the velocity of the particle in pixels per second.
Particle
  velY : Number = 0
The y coordinate of the velocity of the particle in pixels per second.
Particle
  x : Number = 0
The x coordinate of the particle in pixels.
Particle
  y : Number = 0
The y coordinate of the particle in pixels.
Particle
Public Methods
 MethodDefined by
  
Creates a particle.
Particle
  
initialize():void
Sets the particles properties to their default values.
Particle
Property detail
ageproperty
public var age:Number = 0

The age of the particle, in seconds.

angVelocityproperty 
public var angVelocity:Number = 0

The angular velocity of the particle in radians per second.

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:DisplayObject = null

The DisplayObject used to display the image.

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.

matrixTransformproperty 
matrixTransform:Matrix  [read-only]

A transformation matrix for the position, scale and rotation of the particle.

Implementation
    public function get matrixTransform():Matrix
rotationproperty 
public var rotation:Number = 0

The rotation of the particle in radians.

scaleproperty 
public var scale:Number = 1

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

spaceSortXproperty 
public var spaceSortX:uint

The position in the emitter's horizontal spacial sorted array

velXproperty 
public var velX:Number = 0

The x coordinate of the velocity of the particle in pixels per second.

velYproperty 
public var velY:Number = 0

The y coordinate of the velocity of the particle in pixels per second.

xproperty 
public var x:Number = 0

The x coordinate of the particle in pixels.

yproperty 
public var y:Number = 0

The y coordinate of the particle in pixels.

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
initialize()method
public function initialize():void

Sets the particles properties to their default values.