A tile-based particle controlled by a
ParticleEmitter. As the name might suggest, this particle type cannot interact with its surroundings, it's a purely visual element.
In the strictest sense, Foundation doesn't allow for particles (single points). This type is image-based and is axis-aligned. Because of this, dense particle systems are unlikely to run efficiently, but hundreds of these items on screen at a time should be fine on mid-range desktop machines.
Objects of this type are created by a ParticleEmitter, and the emitter controls their life cycle (including rendering). Do not add individual particles to a game. Do not manually create particles, the type is only documented here for deriving purposes.
This type extends:
image property getter returns the image set in the back-referenced emitter (the particles do not have their own image).
This type does not implement any interfaces.
- Get or set a back-reference to the particle's emitter.
- The particle's travel direction.
- The number of world units the particle should travel per second.
- The alpha change which should occur in the particle per second.
- Alpha is clamped to [0,1].
- A positive or negative value can be used.
- The particle's allowed lifetime in seconds. E.g.
1.5will keep the particle alive for 1.5 seconds.
(bounds: Rectangle, emitter: ParticleEmitter)
bounds: The starting position and size of the particle.
emitter: Back-reference to the owning emitter.
resetProperties(positionX: number, positionY: number, alpha: number, directionX: number, directionY: number, velocityDT: number, alphaDT: number, life: number)
- Reset particle state. Internal storage structures are reused.
positionYwill be normalized.