| 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 : 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 | ||
| 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 [override]
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 [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 | ||
![]() | updateParticles(ev:Event):void | SpriteRendererBase | |
| camera | property |
camera:CameraThe camera controls the view for the renderer
public function get camera():Camera public function set camera(value:Camera):void| zSort | property |
zSort:BooleanIndicates whether the particles should be sorted in distance order for display.
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 |
override protected 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.
Parameters
particle:Particle — The particle being added to the emitter.
|
| removeParticle | () | method |
override protected 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.
Parameters
particle:Particle — The particle being removed from the emitter.
|
| renderParticles | () | method |
override protected 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.
Parameters
particles:Array — The particles to be rendered.
|