| Package | org.flintparticles.renderers |
| Class | public class PixelRenderer |
| Inheritance | PixelRenderer BitmapRenderer flash.display.Sprite |
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
| Method | Defined by | ||
|---|---|---|---|
|
PixelRenderer(canvas:Rectangle)
The constructor creates a PixelRenderer.
| PixelRenderer | ||
![]() |
addFilter(filter:BitmapFilter, postRender:Boolean = false):void
The addFilter method adds a BitmapFilter to the renderer.
| BitmapRenderer | |
![]() |
addParticle(particle:Particle):void
The addParticle method is called when a particle is added to the emitter that
this renderer is assigned to.
| BitmapRenderer | |
![]() |
clearPaletteMap():void
Clears any palette map that has been set for the renderer.
| BitmapRenderer | |
![]() |
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 | |
![]() |
removeFilter(filter:BitmapFilter):void
Removes a BitmapFilter object from the Renderer.
| BitmapRenderer | |
![]() |
removeParticle(particle:Particle):void
The removeParticle method is called when a particle is removed from the
emitter that this renderer is assigned to.
| BitmapRenderer | |
![]() |
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 | |
![]() |
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 | ||
|---|---|---|---|
![]() |
createBitmap():void
Create the Bitmap and BitmapData objects
| BitmapRenderer | |
|
drawParticle(particle:Particle):void
Used internally to draw the particles.
| PixelRenderer | ||
| 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.
Parameterscanvas:Rectangle |
| drawParticle | () | method |
protected override function drawParticle(particle:Particle):voidUsed internally to draw the particles.
Parametersparticle:Particle |