You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
772 B
42 lines
772 B
function keyPressed(){
|
|
if (userIsWriting) return true;
|
|
switch(keyCode){
|
|
case 73:
|
|
debug = !debug;
|
|
break;
|
|
}
|
|
if (keyCode != 116) return false;
|
|
}
|
|
|
|
function mouseDragged(){
|
|
colorPicker.mouseDragged();
|
|
for (let a of attractions){
|
|
if (a.isGrabbed) a.grabbed();
|
|
}
|
|
}
|
|
|
|
function mousePressed(){
|
|
colorPicker.mousePressed();
|
|
for (let a of attractions){
|
|
if (dist(a.pos.x, a.pos.y, mouseX + viewPort.x, mouseY + viewPort.y) < a.r){
|
|
a.isGrabbed = true;
|
|
$("#defaultCanvas0").css({
|
|
"cursor": "-webkit-grabbing",
|
|
"cursor": "grabbing"
|
|
});
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
function mouseReleased(){
|
|
colorPicker.mouseReleased();
|
|
for (let a of attractions){
|
|
if (a.isGrabbed){
|
|
a.isGrabbed = false;
|
|
$("#defaultCanvas0").css({
|
|
"cursor": "auto"
|
|
});
|
|
}
|
|
}
|
|
} |