The VectorLayer class draws the IVectors in its list to a single Graphics.
Though using the VectorLayer can prove to be a very convient way to draw vectors
it doesn't necessarily yield any amazing performance differences. This is until the
bitmapData property is used to get a bitmap render of the vector drawing allowing for
further optimizations than the built-in cacheAsBitmap property can yield.
bitmap:Bitmap [read-only]
Returns a transparent Bitmap of the drawing.
Implementation
public function get bitmap():Bitmap
bitmapData:BitmapData [read-only]
Returns a transparent BitmapData of the drawing.
Implementation
public function get bitmapData():BitmapData
layerHeight:int [read-write]Implementation
public function get layerHeight():int
public function set layerHeight(value:int):void
layerWidth:int [read-write]Implementation
public function get layerWidth():int
public function set layerWidth(value:int):void
public var list:Array
The list of IVectors to be drawn on each render.
public var rect:Rectangle
public function VectorLayer(width:int = 500, height:int = 500, bgColor:Object = null, cacheAsBitmap:Boolean = false)Parameters
| width:int (default = 500) |
| |
| height:int (default = 500) |
| |
| bgColor:Object (default = null) |
| |
| cacheAsBitmap:Boolean (default = false) |
public function add(vector:IVector):IVector
Adds an IVector into the list.
Parameters
Returns
protected function addEvent(item:EventDispatcher, type:String, liststener:Function, priority:int = 0, useWeakReference:Boolean = true):voidParameters
| item:EventDispatcher |
| |
| type:String |
| |
| liststener:Function |
| |
| priority:int (default = 0) |
| |
| useWeakReference:Boolean (default = true) |
public function clear():void
Removes all IVectors from the list.
public function dispose():void
Disposes the VectorLayer ready for garbage collection.
public function remove(vector:IVector):Boolean
Removes an IVector into the list.
Parameters
Returns
protected function removeEvent(item:EventDispatcher, type:String, listener:Function):voidParameters
| item:EventDispatcher |
| |
| type:String |
| |
| listener:Function |
public function render(e:Event = null):voidParameters
public function startRender():void
Starts rendering the VectorLayer on construction rendering automatically starts.
public function stopRender():void
Stops rendering the VectorLayer this can be resumed via the startRender method.
public override function toString():String
Returns