first commit

This commit is contained in:
Sam Keddy
2019-03-26 23:20:54 +00:00
commit 7126e83f5f
67 changed files with 9722 additions and 0 deletions

18
js/_getCursorPosition.js Normal file
View File

@ -0,0 +1,18 @@
//get cursor position relative to canvas
function getCursorPosition(e) {
var x;
var y;
if (e.pageX != undefined && e.pageY != undefined) {
x = e.pageX;
y = e.pageY;
}
else {
x = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
y = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
}
x -= canvas.offsetLeft;
y -= canvas.offsetTop;
return [x,y];
}