We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hey! I'm relatively new to Processing & programming in general. I'm trying to build a painting program that paints with a pink dot and the screen clears with a click. I couldn't find any examples of this problem on the internet. Help?
Here's the code:
void setup() { size (500,500); noStroke(); }
void draw(){ if (mousePressed) { background(0); }else{ background(0);
}ellipse(mouseX,mouseY,33,33); if(mousePressed) { fill(0); }else{ fill(250,0,209); } }
Answers
I can see a problem from start. If you click to clear, then you will clear every time you paint.
I would suggest to come up with another method. While mousePressed, draw. When mouseReleased: stop drawing. With a double click, reset.
One more thing. To format code in this forum, select your code and press ctrl+o. i hope this helps,
Kf
Thank you!