Packageorg.flintparticles.twoD.renderers
Classpublic class DisplayObjectRenderer
InheritanceDisplayObjectRenderer Inheritance SpriteRendererBase Inheritance flash.display.Sprite

The DisplayObjectRenderer adds particles to its display list and lets the flash player render them in its usual way.

Particles may be represented by any DisplayObject and each particle must use a different DisplayObject instance. The DisplayObject to be used should not be defined using the SharedImage initializer because this shares one DisplayObject instance between all the particles. The ImageClass initializer is commonly used because this creates a new DisplayObject for each particle.

The DisplayObjectRenderer has mouse events disabled for itself and any display objects in its display list. To enable mouse events for the renderer or its children set the mouseEnabled or mouseChildren properties to true.

Because the DisplayObject3DRenderer directly uses the particle's image, it is not suitable in situations where the same particle will be simultaneously displayed by two different renderers.



Public Properties
 PropertyDefined By
 Inheritedemitters : Vector.<Emitter>
The array of all emitters being rendered by this renderer.
SpriteRendererBase
Protected Properties
 PropertyDefined By
 Inherited_particles : Array
SpriteRendererBase
Public Methods
 MethodDefined By
  
The constructor creates a DisplayObjectRenderer.
DisplayObjectRenderer
 Inherited
addEmitter(emitter:Emitter):void
Adds the emitter to the renderer.
SpriteRendererBase
 Inherited
removeEmitter(emitter:Emitter):void
Removes the emitter from the renderer.
SpriteRendererBase
Protected Methods
 MethodDefined By
  
addParticle(particle:Particle):void
[override] The addParticle method is called when a particle is added to one of the emitters that is being rendered by this renderer.
DisplayObjectRenderer
 Inherited
SpriteRendererBase
  
removeParticle(particle:Particle):void
[override] The removeParticle method is called when a particle is removed from one of the emitters that is being rendered by this renderer.
DisplayObjectRenderer
  
renderParticles(particles:Array):void
[override] The renderParticles method is called during the render phase of every frame if the state of one of the emitters being rendered by this renderer has changed.
DisplayObjectRenderer
 Inherited
updateParticles(ev:Event):void
SpriteRendererBase
Constructor Detail
DisplayObjectRenderer()Constructor
public function DisplayObjectRenderer()

The constructor creates a DisplayObjectRenderer. After creation it should be added to the display list of a DisplayObjectContainer to place it on the stage and should be applied to an Emitter using the Emitter's renderer property.

See also

org.flintparticles.twoD.emitters.Emitter.renderer
Method Detail
addParticle()method
override protected function addParticle(particle:Particle):void

The addParticle method is called when a particle is added to one of the emitters that is being rendered by this renderer.

Parameters

particle:Particle — The particle.

removeParticle()method 
override protected function removeParticle(particle:Particle):void

The removeParticle method is called when a particle is removed from one of the emitters that is being rendered by this renderer.

Parameters

particle:Particle — The particle.

renderParticles()method 
override protected function renderParticles(particles:Array):void

The renderParticles method is called during the render phase of every frame if the state of one of the emitters being rendered by this renderer has changed.

Parameters

particles:Array — The particles being managed by all the emitters being rendered by this renderer. The particles are in no particular order.