2023-01-18 16:18:38 +01:00

20 lines
504 B
JavaScript

// Sketch 1.1: Mouse Events!
function setup() {
createCanvas(800, 800);
}
function draw() {
// background("yellow");
if(mouseIsPressed) {
print("Pressed: " + mouseX + " - " + mouseY) ; // see the console below ↓
background("yellow"); // 2
}
}
function mouseMoved() {
print("Moved: " + mouseX + " - " + mouseY) ; // see the console below ↓
circle(mouseX, mouseY, 10);
}
// Reference: https://p5js.org/reference/