| Package | org.flintparticles.twoD.renderers |
| Class | public class DisplayObjectRenderer |
| Inheritance | DisplayObjectRenderer SpriteRendererBase flash.display.Sprite |
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.
| Method | Defined By | ||
|---|---|---|---|
The constructor creates a DisplayObjectRenderer. | DisplayObjectRenderer | ||
![]() | addEmitter(emitter:Emitter):void
Adds the emitter to the renderer. | SpriteRendererBase | |
![]() | removeEmitter(emitter:Emitter):void
Removes the emitter from the renderer. | SpriteRendererBase | |
| Method | Defined 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 | ||
![]() | emitterUpdated(ev:EmitterEvent):void | 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 | ||
![]() | updateParticles(ev:Event):void | SpriteRendererBase | |
| 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
| addParticle | () | method |
override protected function addParticle(particle:Particle):voidThe 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):voidThe 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):voidThe 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.
|