Mousing over oblong shapes
in
Programming Questions
•
2 years ago
I have a strange shape that I have built with the beginShape tool, and I would like to know how I can have the mouse change it's cursor type upon a mouseover.
I am capable of doing this with rectangles or circles, and usually do that by plotting boundaries in an if-then statement.
for example:
rect(500,500,25,25);
if (mouseX >= 500 && mouseX <= 525 && mouseY >=500 && mouseY <=525) {
cursorMode(HAND);
}
or...
ellipse(500,500,25,25)
if(dist(mouseX,mouseY,500,500) =<25) {
cursorMode(HAND);
}
my beginShape is very large, about 100 vertices, no point in posting it...But how could I create a conditional for when the mouseX and mouseY are over the shape?
Thanks in advance,
M
I am capable of doing this with rectangles or circles, and usually do that by plotting boundaries in an if-then statement.
for example:
rect(500,500,25,25);
if (mouseX >= 500 && mouseX <= 525 && mouseY >=500 && mouseY <=525) {
cursorMode(HAND);
}
or...
ellipse(500,500,25,25)
if(dist(mouseX,mouseY,500,500) =<25) {
cursorMode(HAND);
}
my beginShape is very large, about 100 vertices, no point in posting it...But how could I create a conditional for when the mouseX and mouseY are over the shape?
Thanks in advance,
M
1