0.2.9 • Published 7 years ago

drawingjs v0.2.9

Weekly downloads
6
License
ISC
Repository
github
Last release
7 years ago

This package is not yet finished.

DrawingJS

DrawingJS will offer an easy API to create images and animations with JavaScript.

Drawing

Constructor (canvasID, width, height)

  • 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

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.

Methods

addElement(element)

  • 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.

draw()

Starts drawing the elements that have been added to the drawing.

Rectangle

Constructor(options)

  • 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.
0.2.9

7 years ago

0.2.8

7 years ago

0.2.7

7 years ago

0.2.6

7 years ago

0.2.5

7 years ago

0.2.4

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.15

7 years ago

0.0.14

7 years ago

0.0.13

7 years ago

0.0.12

7 years ago

0.0.11

7 years ago

0.0.10

7 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago