xxxxxxxxxx
27
function setup() {
createCanvas(1000, 1000);
}
function draw() {
background(220);
if (mouseIsPressed) {
textSize(15);
text("x: " + mouseX + "y: " + mouseY, mouseX, mouseY);
} else {
textSize(10);
for (x = 100; x <= width; x+= 100){
fill(255, 0, 0);
text("x: " + x, x, 20);
fill(0);
for (y = 100; y <= height; y+= 100){
fill(255, 0, 0);
text("y: " + y, 20, y);
fill(0);
text("x: " + x + " y: " + y, x, y);
}
}
}
}