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

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

This uses BitmapData to display particles.



Public Properties
 PropertyDefined By
  active : Boolean
[read-only] If the renderer is running.
BitmapRenderer
  automagic : Boolean
[read-only] If the renderer is currently running in automagic mode.
BitmapRenderer
  bitmapdata : BitmapData
The BitmapData to render to.
BitmapRenderer
  fade : 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
  fadeBlur : int
The amount of blur to perform on the fade.
BitmapRenderer
  offset : 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
  predraw : Boolean = false
If true, this draws the particles first, then applies the fade/fadeblur, then the renderfunc.
BitmapRenderer
  renderfunc : 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
  
BitmapRenderer(width:int, height:int, order:String = top, automagic:Boolean = true)
Creates a new BitmapRenderer.
BitmapRenderer
 Inherited
[override] This adds a particle to the display.
StandardRenderer
  
This starts the automagic mode that will automagically start/stop the renderer based on need.
BitmapRenderer
  
This stops the automagic mode that automagically starts/stops the renderer based on need.
BitmapRenderer
  
clear():void
This clears the BitmapData on the renderer.
BitmapRenderer
 Inherited
This removes all current particles from the renderer.
StandardRenderer
 Inherited
[override] This removes a particle from the display.
StandardRenderer
  
resize(width:int, height:int):void
This "resizes" the BitmapData for the renderer.
BitmapRenderer
  
start():void
Starts the renderer writing to the BitmapData.
BitmapRenderer
  
stop():void
Stops the renderer from writing to the BitmapData.
BitmapRenderer
Property Detail
activeproperty
active:Boolean  [read-only]

If the renderer is running.


Implementation
    public function get active():Boolean
automagicproperty 
automagic:Boolean  [read-only]

If the renderer is currently running in automagic mode.


Implementation
    public function get automagic():Boolean
bitmapdataproperty 
public var bitmapdata:BitmapData

The BitmapData to render to.

fadeproperty 
fade: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.


Implementation
    public function get fade():Number
    public function set fade(value:Number):void
fadeBlurproperty 
fadeBlur:int

The amount of blur to perform on the fade.


Implementation
    public function get fadeBlur():int
    public function set fadeBlur(value:int):void
offsetproperty 
public var offset:Point

This is a Point for the offset of the bitmapdata.

predrawproperty 
public var predraw:Boolean = false

If true, this draws the particles first, then applies the fade/fadeblur, then the renderfunc. If false, it draws the particles after (default).

renderfuncproperty 
public var renderfunc:Function

What function to run on the bitmap on each render.

Constructor Detail
BitmapRenderer()Constructor
public function BitmapRenderer(width:int, height:int, order:String = top, automagic:Boolean = true)

Creates a new BitmapRenderer. Use a BitmapCanvas object to display the particle bitmap.

Parameters
width:int — The width of the Bitmap.
 
height:int — The height of the Bitmap.
 
order:String (default = top) — The visual stacking order for new particles to be created – 'top', 'bottom', or 'random'.
 
automagic:Boolean (default = true) — If the renderer should start in automagic mode (starts/stops renderer based on need, recommended).
Method Detail
automagicModeStart()method
public function automagicModeStart():void

This starts the automagic mode that will automagically start/stop the renderer based on need. This starts automatically by default when the renderer is created.

automagicModeStop()method 
public function automagicModeStop():void

This stops the automagic mode that automagically starts/stops the renderer based on need.

clear()method 
public function clear():void

This clears the BitmapData on the renderer.

resize()method 
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

start()method 
public function start():void

Starts the renderer writing to the BitmapData.

stop()method 
public function stop():void

Stops the renderer from writing to the BitmapData.