new Linen(canvas)
Parameters:
Name | Type | Default | Description |
---|---|---|---|
canvas |
object |
false
|
HTML DOM reference to canvas element |
Classes
Methods
addElement(type) → {Object|Boolean}
Factory to create Linen element and add it to the canvas.
Parameters:
Name | Type | Description |
---|---|---|
type |
string |
Returns:
- Type
- Object | Boolean
setWidth(width) → {Linen}
Set the width of the HTML5 canvas node
Parameters:
Name | Type | Description |
---|---|---|
width |
string |
Returns:
- Type
- Linen
setHeight(height) → {Linen}
Set the height of the HTML5 canvas node
Parameters:
Name | Type | Description |
---|---|---|
height |
string |
Returns:
- Type
- Linen
getUrl(format) → {string}
Get the dataURL of the canvas.
Note: this may not work if you've "tainted" the canvas with an image.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
format |
string |
image/png
|
image/png | image/jpg |
Returns:
- Type
- string
context() → {CanvasRenderingContext2D}
Get the canvas' context
Returns:
- Type
- CanvasRenderingContext2D
render()
Sort the elements by zindex and start the rendering queue.