How can make my circle draw when you click the mouse?
in
Programming Questions
•
11 months ago
Hi, I just started using code last week and I am working on a project involving processing. So far this is my code but I was wondering if someone could show me how I could get my circle to draw when the mouse is clicked/ held down for a period of time. My goal is to have the circle draw on the screen and then once you press the space bar it erases the screen and you can start your drawing over again.
this is the code I have so far:
void setup()
{
size(640, 480);
}
void draw()
{
background(255);
fill (0);
ellipse(mouseX, mouseY, 5, 5);
}
void keyPressed() {
background(255);
}
1