I'm trying to make a program, that has nodes drawn on with lines connecting the nodes, but I'm having trouble with being able to select a line. The way I select nodes is by looping through each node's position when the mouse is clicked, and seeing if the mouse is on top of the node's position.
However I can't think of a way to be able to select a link. The link is drawn on during the loop() function, which is just a line() command with the two nodes' positions as parameters. So when the mouse is clicked, I'm not sure what the best way to check if each link is being clicked.
Any suggestions are welcome, thanks.
1