Hello,
I am trying to write a distance function that will compute the distance between a (x,y) coordinate and the mouse coordinates. But when I call mouseX or mouseY from within the function that I am writing I get the error "mouseX was not declared in the scope"
Is there any way to use a OF function from within a function?
Here is my code:
float distance(int n,int valX, int valY){
float d;
d = sqrt((valY-mouseY)*(valY-mouseY)+(valX-mouseX)(valX-mouseX));
return d;
}