The ParticleField
class lets you create a field of particles in an easy way. The particles are positioned randomly within limits that you set. The following lines demonstrate how you can instantiate a particle field and add it to the scene:
var particleField:ParticleField = new ParticleField(material,1000,5, 1800,1800,1800); scene.addChild(particleField);
When you create a particle field, you don't have to instantiate the Particles
or Particle
classes—the ParticleField
class takes care of this.
The ParticleField
constructor has one required and five optional parameters as shown in the next table:
Parameter |
Data type |
Default value |
Description | |
---|---|---|---|---|
1 |
mat |
ParticleMaterial |
— |
The material to apply to the particles. This can be any of the three types we have discussed. |
2 |
quantity |
int |
200 |
Sets the number of particles. |
3 |
particleSize |
Number |
4 |
Defines the size (that is, scale) of the particles. |
4 |
fieldWidth... |