Drag to create ellipse size
in
Programming Questions
•
2 years ago
Im trying to create an ellipse whose radius is determined by the distance from when the mouse is clicked and when the mouse is released but i keep getting an error. Here's my code so far, thanks in advance
- float r = dist(startPointX, startPointY, endPointX, endPointY);
void setup(){
size (300, 300);
}
void draw(){
background(0);
ellipse (mouseX, mouseY, r, r);
}
void mouseClicked(){
float startPointX = mouseX;
float startPointY = mouseY;
}
void mouseReleased(){
float endPointX = mouseX;
float endPointY = mouseY;
}
1