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

The DisplayObjectRenderer is a native Flint 3D renderer that draws particles as display objects in the renderer. The particles are drawn face-on to the camera, with perspective applied to position and scale the particles.

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.



Public Properties
 PropertyDefined By
  camera : Camera
The camera controls the view for the renderer
DisplayObjectRenderer
 Inheritedemitters : Vector.<Emitter>
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
Protected Properties
 PropertyDefined By
 Inherited_particles : Array
SpriteRendererBase
Public Methods
 MethodDefined By
  
DisplayObjectRenderer(zSort:Boolean = true)
The constructor creates a DisplayObject3DRenderer.
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] This method is called when a particle is added to an emitter - usually becaus ethe emitter has just created the particle.
DisplayObjectRenderer
 Inherited
SpriteRendererBase
  
removeParticle(particle:Particle):void
[override] This method is called when a particle is removed from an emitter - usually because the particle is dying.
DisplayObjectRenderer
  
renderParticles(particles:Array):void
[override] This method positions and scales the particles according to the particles' positions relative to the camera viewport.
DisplayObjectRenderer
 Inherited
updateParticles(ev:Event):void
SpriteRendererBase
Property Detail
cameraproperty
camera:Camera

The camera controls the view for the renderer


Implementation
    public function get camera():Camera
    public function set camera(value:Camera):void
zSortproperty 
zSort:Boolean

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
Constructor Detail
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.

Parameters
zSort:Boolean (default = true) — Whether to sort the particles according to their z order when rendering them or not.
Method Detail
addParticle()method
override protected function 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. 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.

Parameters

particle:Particle — The particle being added to the emitter.

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

This 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.

Parameters

particle:Particle — The particle being removed from the emitter.

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

This 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.

Parameters

particles:Array — The particles to be rendered.