We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi guys, I've been trying to figure out how to create a "stamp" whenever I click on the mouse button, but for somehow it isn't working. I still want to be able to see the circle while pressing the "stamp" on the background. Any suggestions and advice in this code? I also want to remove the printed figures in the background by just resetting the background with pressing a key.
void setup() {
background(125);
size(500, 500);
smooth();
}
void draw() {
background(125);
stroke(255, 0, 200);
fill(mouseY, mouseX, 200);
ellipse(pmouseX, pmouseY, 100, 100);
}
void mousePressed() {
background(125);
fill(mouseX,mouseY,155);
ellipse(mouseX,mouseY,150,150);
}
void keyPressed() {
background(125);
}
Answers
You gotta create a PGraphics object to be your separate drawing layer. :P
When you paste code into this forum - highlight and click on the 'C' button. This will ensure that the code is formatted for others to read.
If you want multiple 'stamps' visible at any one time you need to remember where they are an redraw them every time in draw()
Thanks a lot for the help guys!