| Package | org.flintparticles.threeD.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 displayed by two different renderers.
| Property | Defined by | ||
|---|---|---|---|
| camera : Camera
The camera controls the view for the renderer
| DisplayObjectRenderer | ||
![]() | emitters : Array
The array of all emitters being rendered by this renderer.
| SpriteRendererBase | |
| zSort : Boolean
Indicates whether the particles should be sorted in distance order for display.
| DisplayObjectRenderer | ||
| Method | Defined by | ||
|---|---|---|---|
|
DisplayObjectRenderer(zSort:Boolean = true)
The constructor creates a DisplayObject3DRenderer.
| 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
This method is called when a particle is added to an emitter -
usually becaus ethe emitter has just created the particle.
| DisplayObjectRenderer | ||
![]() |
emitterUpdated(ev:EmitterEvent):void
| SpriteRendererBase | |
|
removeParticle(particle:Particle):void
This method is called when a particle is removed from an emitter -
usually because the particle is dying.
| DisplayObjectRenderer | ||
|
renderParticles(particles:Array):void
This method positions and scales the particles according to the
particles' positions relative to the camera viewport.
| DisplayObjectRenderer | ||
![]() |
updateParticles(ev:Event):void
| SpriteRendererBase | |
| camera | property |
camera:Camera [read-write]The camera controls the view for the renderer
Implementation public function get camera():Camera
public function set camera(value:Camera):void
| zSort | property |
zSort:Boolean [read-write]Indicates whether the particles should be sorted in distance order for display.
Implementation public function get zSort():Boolean
public function set zSort(value:Boolean):void
| DisplayObjectRenderer | () | constructor |
public function DisplayObjectRenderer(zSort:Boolean = true)The constructor creates a DisplayObject3DRenderer. After creation the renderer should be added to the display list of a DisplayObjectContainer to place it on the stage.
Emitter's should be added to the renderer using the renderer's addEmitter method. The renderer displays all the particles created by the emitter's that have been added to it.
ParameterszSort:Boolean (default = true) — Whether to sort the particles according to their
z order when rendering them or not.
|
| addParticle | () | method |
protected override function addParticle(particle:Particle):voidThis method is called when a particle is added to an emitter - usually becaus ethe emitter has just created the particle. The method adds the particle's image to the renderer's display list. It is called internally by Flint and need not be called by the user.
Parametersparticle:Particle — The particle being added to the emitter.
|
| removeParticle | () | method |
protected override function removeParticle(particle:Particle):voidThis method is called when a particle is removed from an emitter - usually because the particle is dying. The method removes the particle's image from the renderer's display list. It is called internally by Flint and need not be called by the user.
Parametersparticle:Particle — The particle being removed from the emitter.
|
| renderParticles | () | method |
protected override function renderParticles(particles:Array):voidThis method positions and scales the particles according to the particles' positions relative to the camera viewport.
This method is called internally by Flint and shouldn't need to be called by the user.
Parametersparticles:Array — The particles to be rendered.
|