Packagecom.desuade.partigen.renderers
Classpublic class PixelRenderer
InheritancePixelRenderer Inheritance BitmapRenderer Inheritance StandardRenderer Inheritance Renderer Inheritance flash.events.EventDispatcher

Language Version : ActionScript 3
Since : 29.04.2010
Runtime Versions : AIR 1.0, Flash Player 9.0.0

This uses BitmapData to display particles as pixels.



Public Properties
 PropertyDefined By
 Inheritedactive : Boolean
[read-only] If the renderer is running.
BitmapRenderer
 Inheritedautomagic : Boolean
[read-only] If the renderer is currently running in automagic mode.
BitmapRenderer
 Inheritedbitmapdata : BitmapData
The BitmapData to render to.
BitmapRenderer
 Inheritedfade : Number
The amount of fade to perform on the BitmapData. A value of 0 will instantly fade the BitmapData, leaving no trail. A value of 1 will not fade the BitmapData, "painting" the screen. Any value in between will fade the BitmapData, like a motion trail.
BitmapRenderer
 InheritedfadeBlur : int
The amount of blur to perform on the fade.
BitmapRenderer
 Inheritedoffset : Point
This is a Point for the offset of the bitmapdata.
BitmapRenderer
 Inheritedorder : String
The visual stacking order for new particles to be created – 'top', 'bottom', or 'random'.
StandardRenderer
  particles : Object
[read-only] An object of all the current particles in the renderer.
PixelRenderer
 Inheritedpredraw : Boolean = false
If true, this draws the particles first, then applies the fade/fadeblur, then the renderfunc.
BitmapRenderer
 Inheritedrenderfunc : Function
What function to run on the bitmap on each render.
BitmapRenderer
 Inheritedtarget : DisplayObjectContainer
A visible DisplayObject that will "hold" the particles on the screen.
StandardRenderer
Public Methods
 MethodDefined By
  
PixelRenderer(width:int, height:int, automagic:Boolean = true)
This creates a new PixelRenderer to render PixelParticles. Note: If regular Particles are used, it will convert them into a single pixel.
PixelRenderer
  
[override] This adds a particle to the display.
PixelRenderer
 Inherited
This starts the automagic mode that will automagically start/stop the renderer based on need.
BitmapRenderer
 Inherited
This stops the automagic mode that automagically starts/stops the renderer based on need.
BitmapRenderer
 Inherited
clear():void
This clears the BitmapData on the renderer.
BitmapRenderer
  
[override] This removes all current particles from the renderer.
PixelRenderer
  
[override] This removes a particle from the display.
PixelRenderer
  
resize(width:int, height:int):void
[override] This "resizes" the BitmapData for the renderer.
PixelRenderer
 Inherited
start():void
Starts the renderer writing to the BitmapData.
BitmapRenderer
 Inherited
stop():void
Stops the renderer from writing to the BitmapData.
BitmapRenderer
Protected Methods
 MethodDefined By
  
drawMethod():void
[override]
PixelRenderer
Property Detail
particlesproperty
particles:Object  [read-only]

An object of all the current particles in the renderer.


Implementation
    public function get particles():Object
Constructor Detail
PixelRenderer()Constructor
public function PixelRenderer(width:int, height:int, automagic:Boolean = true)

This creates a new PixelRenderer to render PixelParticles.

Note: If regular Particles are used, it will convert them into a single pixel. For best performance, set your emitter.particleBaseClass to PixelParticle or BasicPixelParticle.

Parameters
width:int — The width of the Bitmap.
 
height:int — The height of the Bitmap.
 
automagic:Boolean (default = true) — If the renderer should start in automagic mode (starts/stops renderer based on need).
Method Detail
addParticle()method
override public function addParticle(p:IBasicParticle):void

This adds a particle to the display.

Parameters

p:IBasicParticle — The particle to add.

drawMethod()method 
override protected function drawMethod():void

removeAllParticles()method 
override public function removeAllParticles():void

This removes all current particles from the renderer. Note: all the particle still exist and run in memory, unless you remove them in their pool as well.

removeParticle()method 
override public function removeParticle(p:IBasicParticle):void

This removes a particle from the display.

Parameters

p:IBasicParticle — The particle to remove.

resize()method 
override public function resize(width:int, height:int):void

This "resizes" the BitmapData for the renderer. Dispatches resize event to listening BitmapCanvases.

Parameters

width:int — The new width
 
height:int — The new height