mouseX and mouseY
in
Programming Questions
•
1 year ago
Hi guys,
I'm trying to figure out a way to draw two points in a window, the first one being drawn at the x,y position that the mouse is clicked first, and the second one being drawn at the x,y position of the second mouse click.
For example, you would click at the position (10,10), and an ellipse would be drawn at that point and stay there;
Then you would click at the position (150,200) and an ellipse would be drawn at that point and stay there.
I've tried doing this many different ways, using mousePressed(), mouseClicked(), mouseX, mouseY, pmouseX and pmouseY, and I'm able to draw the initial point at the originally clicked position, but as soon as I click on a new position for the second point, the first one moves to that point as well.
I'm having trouble figuring out a way to get the first point to stay in it's original clicked position and to get the second point to stay in it's own clicked position.
Any ideas on what I can do?
1