Linen

Linen

new Linen(canvas)

Source:
Parameters:
Name Type Default Description
canvas object false HTML DOM reference to canvas element

Classes

Model
Arc
Image
Line
Rectangle
Text
Canvas
Path

Methods

addElement(type) → {Object|Boolean}

Source:
Factory to create Linen element and add it to the canvas.
Parameters:
Name Type Description
type string
Returns:
Type
Object | Boolean

setWidth(width) → {Linen}

Source:
Set the width of the HTML5 canvas node
Parameters:
Name Type Description
width string
Returns:
Type
Linen

setHeight(height) → {Linen}

Source:
Set the height of the HTML5 canvas node
Parameters:
Name Type Description
height string
Returns:
Type
Linen

getUrl(format) → {string}

Source:
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}

Source:
Get the canvas' context
Returns:
Type
CanvasRenderingContext2D

render()

Source:
Sort the elements by zindex and start the rendering queue.