Default configuration.
Note that events.mouse*
callbacks are triggered only if interactive is set to true.
- Source:
Example
// The following is the default configuration:
$('canvas').sketchable({
interactive: true,
mouseupMovements: false,
relTimestamps: false,
multitouch: true,
cssCursors: true,
filterCoords: false,
// Event hooks.
events: {
init: function(elem, data) {
// Called when the Sketchable instance is created.
},
destroy: function(elem, data) {
// Called when the Sketchable instance is destroyed.
},
clear: function(elem, data) {
// Called when the canvas is cleared.
// This event includes clearing strokes data, too.
},
mousedown: function(elem, data, evt) {
// Called when the user clicks or taps on the canvas.
},
mousemove: function(elem, data, evt) {
// Called when the user moves the mouse or finger over the canvas.
},
mouseup: function(elem, data, evt) {
// Called when the user lifts the mouse or finger off the canvas.
},
},
// Drawing options, to be used in jSketch lib.
graphics: {
firstPointSize: 3,
lineWidth: 3,
strokeStyle: '#F0F',
fillStyle: '#F0F',
lineCap: 'round',
lineJoin: 'round',
miterLimit: 10
}
});