void setup() { size(200, 200); background(255); noStroke(); } void loop() { // this is not the black square // we just paint a semitransparent white square to fade fill(255,50); rect(0,0,200,200); // now this is the black square int deltax=pmouseX-mouseX; int deltay=pmouseY-mouseY; fill(0,100); quad(25+deltax,25+deltax,175+deltay,25+deltay,175+deltax,175+deltax,25+deltay,175+deltay); }