Is there some way I can get the mouse position before the last position?

edited March 2017 in Questions about Code

Hey all. Here is what I have,for now I can only generate two rects with the current mouse position and the previous mouse position,but how can I draw more rects with the positions before previous position ? Thanks a lot for your help.

void setup(){
size(500,500);
smooth();
frameRate(2c0);
}
void draw(){
background(255);
strokeWeight(3);

rect(pmouseX-35,pmouseY-35,70,70);
rect(mouseX-35,mouseY-35,70,70);}
Tagged:
Sign In or Register to comment.