WireItLibrary

WireIt  0.6.0

WireItLibrary > WireIt > WireIt.CanvasElement
Search:
 
Filters

Class WireIt.CanvasElement

Known Subclasses:
WireIt.Wire WireIt.RubberBand WireIt.LayerMap
Create a canvas element and wrap cross-browser hacks to resize it

Constructor

WireIt.CanvasElement ( parentNode )
Parameters:
parentNode <HTMLElement> The canvas tag will be append to this parent DOM node.

Properties

element - HTMLElement

The canvas element

Methods

destroy

void destroy ( )
Purge all event listeners and remove the component from the dom

getContext

CanvasContext getContext ( [mode] )
Get a drawing context
Parameters:
[mode] <String> Context mode (default "2d")
Returns: CanvasContext
the context

SetCanvasRegion

void SetCanvasRegion ( left , top , width , height )
Set the canvas position and size. Warning: This method changes the element property under some brother. Don't copy references !
Parameters:
left <Number> Left position
top <Number> Top position
width <Number> New width
height <Number> New height


Copyright © 2010 Eric Abouaf All rights reserved.