xxxxxxxxxx
46
let clicks = 0;
function setup() {
createCanvas(windowWidth, windowHeight, SVG);
strokeWeight(1); // do 0.1 for laser
stroke(255, 0, 0); // red is good for laser
noFill(); // better not to have a fill for laser
line(30, 20, 85, 75);
}
function windowResized() {
resizeCanvas(windowWidth, windowHeight);
}
function draw() {
background(220);
stroke(0); {
line(mouseX,mouseY,pmouseX,pmouseY);
}
/*
noStroke();
textSize(50);
text(clicks, width/2, height/2);
*/
}
function mousePressed() {
clicks++;
}
// We use the key pressed function here
function keyPressed() {
// If you hit the s key, save an image
if (key == 'a') {
save("mySVG.svg");
}
}