Package | com.desuade.partigen.pools |
Class | public class Pool |
Inheritance | Pool ![]() |
Subclasses | BasicPool, NullPool |
Language Version : | ActionScript 3 |
Since : | 07.05.2009 |
Runtime Versions : | AIR 1.0, Flash Player 9.0.0 |
Property | Defined By | ||
---|---|---|---|
length : int [read-only]
Returns the total amount of particles in the pool. | Pool | ||
onLastParticle : Function
The method to call each time the last living particle returns to the pool. | Pool | ||
particleClass : Class [read-only]
Gets the class of particle the pool creates. | Pool | ||
particles : Dictionary [read-only]
A Dictionary object of all the current "living" particles. | Pool |
Method | Defined By | ||
---|---|---|---|
Pool(particleClass:Class)
Creates a Pool to store particle objects. | Pool | ||
Adds a new particle to the Pool. | Pool | ||
purge():void
This does nothing for Sweep and Null pools. | Pool | ||
removeParticle(particle:*):void
Removes the specified particle from the Pool.
If you're trying to remove a particle through custom code, it is recommended to simply call particle.kill() than to work directly with the pool.
| Pool | ||
setClass(particleClass:Class):void
This sets the particleClass to the new class and deals with reseting the internal pool. | Pool |
length | property |
length:int
[read-only] Returns the total amount of particles in the pool.
public function get length():int
onLastParticle | property |
onLastParticle:Function
The method to call each time the last living particle returns to the pool.
public function get onLastParticle():Function
public function set onLastParticle(value:Function):void
particleClass | property |
particleClass:Class
[read-only] Gets the class of particle the pool creates.
public function get particleClass():Class
particles | property |
particles:Dictionary
[read-only] A Dictionary object of all the current "living" particles. The key|value pair is particle|particle.id.
public function get particles():Dictionary
Pool | () | Constructor |
public function Pool(particleClass:Class)
Creates a Pool to store particle objects. This base class should not be created, as it offers no direct functionality.
ParametersparticleClass:Class — The class of particle the pool will create.
|
addParticle | () | method |
public function addParticle():IBasicParticle
Adds a new particle to the Pool.
ReturnsIBasicParticle — The particle created.
|
purge | () | method |
public function purge():void
This does nothing for Sweep and Null pools.
removeParticle | () | method |
public function removeParticle(particle:*):void
Removes the specified particle from the Pool.
If you're trying to remove a particle through custom code, it is recommended to simply call particle.kill() than to work directly with the pool.
Parameters
particle:* — The particle to remove.
|
setClass | () | method |
public function setClass(particleClass:Class):void
This sets the particleClass to the new class and deals with reseting the internal pool.
Parameters
particleClass:Class |