We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I was wondering what the best way to limit mouse movement, for example if I put mouseX and mouseY on these pupils
ellipse(280,165,28,28); //Left Eye
ellipse(310,165,28,28); //Right Eye
fill(0);
ellipse(278,162,3,3); //Left Pupil
ellipse(315,167,3,3); //Right Pupil
how would I limit movement to within the eyes?
Answers
constrain()
Thanks, I see the params are n low and high, what would be the best way to set this to the ellipse of the left eye?
maybe set x&y as n, then set Left Eye to a variable and use that for both low and high?
I really appreciate your quick responses
I just realized I am posting this in the wrong area, should be in p5.js questions not processing, sorry.. I've shared the work here.
got it working with createVector, thanks!