Drawing program
in
Programming Questions
•
2 years ago
Hello,
I am trying to make a simple drawing program, and I want to click the button and then draw an ellipse, but in won't draw out of the button. Can you guys help me? Here is the code that I have made:
void setup() {
size (500, 500);
smooth();
background (255);
rect(50, 50, 50, 50);
}
void draw() {
if (mousePressed) {
if ((mouseX > 50)&&(mouseX < 100)&& (mouseY > 50)&&(mouseY < 100)) {
drawing();
loop();
}
}
}
void drawing() {
ellipse (mouseX, mouseY, 50, 50);
}
1