sketchpad
v0.1.0
Published
A simple sketchpad.
Downloads
182
Readme
Sketchpad
A simple sketchpad project. (Live Demo)
Authors
Instalation
To install Sketchpad via Bower:
$ bower install sketchpad --save
or use npm:
npm install sketchpad
Usage
Having a canvas on the DOM:
<canvas id="sketchpad"></canvas>
You should simply configure it by instantiating the Sketchpad:
var sketchpad = new Sketchpad({
element: '#sketchpad',
width: 400,
height: 400,
});
After that, the API provides a variety of functionalities:
// undo
sketchpad.undo();
// redo
sketchpad.redo();
// Change color
sketchpad.color = '#FF0000';
// Change stroke size
sketchpad.penSize = 10;
// Playback each sketchpad stroke (10 ms is the time between each line piece)
sketchpad.animate(10);
For more documentation about the project, visit: TBA
Contribute
Just send PR :-)