Jumping to nearest point in a grid
in
Programming Questions
•
2 years ago
Hi, I've had some time with processing, but I still haven't really utilized things like arrays and classes... Anyways the question is how could I choose which point is the mouse closest to in a situation like this:
size(300,300);
for(int gx=0;gx<width;gx=gx+10){
for(int gy=0;gy<width;gy=gy+10){
point(gx,gy);
}}
and maybe draw a red point at whichever spot in the grid is closest to the mouse... any help would be appreciated
1