| Package | org.flintparticles.threeD.renderers |
| Class | public class PixelRenderer |
| Inheritance | PixelRenderer BitmapRenderer SpriteRendererBase flash.display.Sprite |
The region of the projection plane drawn by this renderer must be defined in the canvas property of the BitmapRenderer. Particles outside this region are not drawn.
The PixelRenderer allows the use of BitmapFilters to modify the appearance of the bitmap. Every frame, under normal circumstances, the Bitmap used to display the particles is wiped clean before all the particles are redrawn. However, if one or more filters are added to the renderer, the filters are applied to the bitmap instead of wiping it clean. This enables various trail effects by using blur and other filters.
The PixelRenderer 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.
| Method | Defined By | ||
|---|---|---|---|
PixelRenderer(canvas:Rectangle, zSort:Boolean = false)
The constructor creates a PixelRenderer. | PixelRenderer | ||
![]() | addEmitter(emitter:Emitter):void
Adds the emitter to the renderer. | SpriteRendererBase | |
![]() | addFilter(filter:BitmapFilter, postRender:Boolean = false):void
The addFilter method adds a BitmapFilter to the renderer. | BitmapRenderer | |
![]() | clearPaletteMap():void
Clears any palette map that has been set for the renderer. | BitmapRenderer | |
![]() | removeEmitter(emitter:Emitter):void
Removes the emitter from the renderer. | SpriteRendererBase | |
![]() | removeFilter(filter:BitmapFilter):void
Removes a BitmapFilter object from the Renderer. | BitmapRenderer | |
![]() | setPaletteMap(red:Array = null, green:Array = null, blue:Array = null, alpha:Array = null):void
Sets a palette map for the renderer. | BitmapRenderer | |
| Method | Defined By | ||
|---|---|---|---|
![]() | 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. | SpriteRendererBase | |
![]() | createBitmap():void
Create the Bitmap and BitmapData objects
| BitmapRenderer | |
drawParticle(particle:Particle3D):void [override]
This is the method that draws each particle. | PixelRenderer | ||
![]() | emitterUpdated(ev:EmitterEvent):void | SpriteRendererBase | |
![]() | 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. | SpriteRendererBase | |
![]() | renderParticles(particles:Array):void [override]
This method draws the particles in the bitmap image, positioning and
scaling them according to their positions relative to the camera
viewport. | BitmapRenderer | |
![]() | updateParticles(ev:Event):void | SpriteRendererBase | |
| PixelRenderer | () | Constructor |
public function PixelRenderer(canvas:Rectangle, zSort:Boolean = false)The constructor creates a PixelRenderer. After creation it 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.
Parameterscanvas:Rectangle — The area within the renderer on which particles can be drawn.
Particles outside this area will not be drawn.
| |
zSort:Boolean (default = false) — Whether to sort the particles according to their
z order when rendering them or not.
|
See also
| drawParticle | () | method |
override protected function drawParticle(particle:Particle3D):voidThis is the method that draws each particle. calculates the position of the particle in teh camera's viewport and draws the particle as a single pixel in that location.
Parameters
particle:Particle3D — The particle to draw on the bitmap.
|