PShape Shapes;
void setup() {
size(500,400);
background(10, 80, 100);
}
void draw() {
background(50);
stroke(255);
fill(150);
rect(mouseX, 180, 100, 50);
translate(mouseX, mouseY);
ellipse(0, 0, 40, 40);
// Note that this ellipse will move twice as fast as the previous,
// because transformation accumulate
fill(0, 255, 0, 100);
translate(mouseX, mouseY);
ellipse(0, 0, 40, 40);
if (mousePressed) {
stroke(255);
} else {
stroke(0);
}
line(mouseX-66, mouseY, mouseX+66, mouseY);
line(mouseX, mouseY-66, mouseX, mouseY+66);
}