Packageorg.flintparticles.renderers
Classpublic class PixelRenderer
InheritancePixelRenderer Inheritance BitmapRenderer Inheritance flash.display.Sprite

The PixelRenderer draws particles as single pixels on a Bitmap display object. The region of the particle system covered by this bitmap object must be defined in the canvas property of the PixelRenderer. 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.

This class has been modified in version 1.0.1 of Flint to fix various limitations in the previous version. Specifically, the canvas for drawing the particles on must now be specified by the developer (it previously defaulted to the size and position of the stage).

The previous behaviour, while still flawed, has been improved and given its own renderer, the FullStagePixelRenderer. To retain the previous behaviour, please use the FullStagePixelRenderer.

See also

org.flintparticles.renderers.FullStagePixelRenderer


Public Properties
 PropertyDefined by
 Inheritedcanvas : Rectangle
The canvas is the area within the renderer on which particles can be drawn.
BitmapRenderer
Protected Properties
 PropertyDefined by
 InheritedZERO_POINT : Point
[static]
BitmapRenderer
Public Methods
 MethodDefined by
  
PixelRenderer(canvas:Rectangle)
The constructor creates a PixelRenderer.
PixelRenderer
 Inherited
addFilter(filter:BitmapFilter, postRender:Boolean = false):void
The addFilter method adds a BitmapFilter to the renderer.
BitmapRenderer
 Inherited
addParticle(particle:Particle):void
The addParticle method is called when a particle is added to the emitter that this renderer is assigned to.
BitmapRenderer
 Inherited
Clears any palette map that has been set for the renderer.
BitmapRenderer
 Inherited
dispose():void
When the renderer is no longer required, this method must be called by the user to free up memory used by the renderer.
BitmapRenderer
 Inherited
removeFilter(filter:BitmapFilter):void
Removes a BitmapFilter object from the Renderer.
BitmapRenderer
 Inherited
removeParticle(particle:Particle):void
The removeParticle method is called when a particle is removed from the emitter that this renderer is assigned to.
BitmapRenderer
 Inherited
renderParticles(particles:Array):void
The renderParticles method is called every frame so the renderer can draw the particles that are in the emitter that this renderer is assigned to.
BitmapRenderer
 Inherited
setPaletteMap(red:Array = null, green:Array = null, blue:Array = null, alpha:Array = null):void
Sets a palette map for the renderer.
BitmapRenderer
Protected Methods
 MethodDefined by
 Inherited
createBitmap():void
Create the Bitmap and BitmapData objects
BitmapRenderer
  
drawParticle(particle:Particle):void
Used internally to draw the particles.
PixelRenderer
Constructor detail
PixelRenderer()constructor
public function PixelRenderer(canvas:Rectangle)

The constructor creates a PixelRenderer. 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.

Parameters
canvas:Rectangle
Method detail
drawParticle()method
protected override function drawParticle(particle:Particle):void

Used internally to draw the particles.

Parameters
particle:Particle