Processing Forum
- int lineToolX, lineToolY; void setup() { size(400,400); background(255); frameRate(200); loadPixels(); } void draw() { if(mousePressed){ updatePixels(); stroke(0); strokeWeight(3); noFill(); rect(lineToolX, lineToolY, mouseX-lineToolX, mouseY-lineToolY); } } void mousePressed() { lineToolX = mouseX; lineToolY = mouseY; } void mouseReleased() { loadPixels(); }
- rect(mouseX, mouseY, 55, 55);