This package is not yet finished.
DrawingJS will offer an easy API to create images and animations with JavaScript.
-
canvasID
- The id of the <canvas> element that the drawing should be in. Throws an error if no element with the id exists, or if it is not a <canvas> element.
-
width
- The width of the drawing in pixels. Throws an error if 0 or less.
-
height
- The height of the drawing in pixels. Throws an error if 0 or less.
Properties in bold are those that are usually okay to change from the outside, and will be (without much trouble) respected when you next call draw(). Other properties should only be changed by those who know what they're doing.
-
canvas
- The canvas element of the drawing.
-
context
- The context of the canvas element of the drawing.
-
width
- The width of the drawing in pixels.
-
height
- The height of the drawing in pixels.
-
element
- The element to be added.
Adds element to the drawing. Note that the elements will not be drawn immediately, only once draw() is called. Elements are drawn in the order addElement() was called.
Starts drawing the elements that have been added to the drawing.
-
options
- An object containing the options. The default is a 10x10 rectangle in the upper left corner, any options here will override that. Supported options are:
- size
- An object containing width and height integers, in pixels.
- size
- An object containing the options. The default is a 10x10 rectangle in the upper left corner, any options here will override that. Supported options are: