flowchart3
2014-09-11 00:51:34 +0000
var width = window.innerWidth;
var height = $('body').height() - 3;
var halfWidth = width / 2;
var halfHeight = height / 2;
function drawerSketch(processing) {
// set size
processing.size(width, height);
processing.setup = function() {
};
processing.draw = function() {
processing.line(halfWidth, 0, halfWidth, height);
if (processing.mouseX < halfWidth) {
var mapped_mouseX = processing.map(processing.mouseX, halfWidth, 0, halfWidth, width);
var mapped_pmouseX = processing.map(processing.pmouseX, halfWidth, 0, halfWidth, width);
processing.line(processing.pmouseX, processing.pmouseY, processing.mouseX, processing.mouseY);
processing.line(mapped_pmouseX, processing.pmouseY, mapped_mouseX, processing.mouseY);
}
};
processing.keyPressed = function() {
console.log(processing.key);
};
processing.mousePressed = function() {
};
processing.mouseReleased = function() {
};
}
// attach the sketch function to the canvas
var processingInstance = new Processing(document.getElementById('sketch'), drawerSketch);