on mouseenter irregular shape
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
on mouseenter irregular shape
How do I track when the mouse enters and leaves an irregular shaped area on a picture? If I create an irregular shaped graphic to outline the area in question, the mouseenter and mouseleave handlers use the rectangular shaped bounding box instead of the edge of the graphic within the box.Thanks
howeyb
you probably want to use the within function. for example:
note that there's a difference in how the "within" function and the "is within" operator work, making the "is within" operator unsuitable for your cause.
Code: Select all
on mouseMove theX,theY
if within(the long id of me,(theX, theY)) then
--your code here
end if
end mouseMove
Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
on mouseenter irregular shape
Yes, but i watch a 2 pixels margin for diagonals
You can see this msg
http://forums.runrev.com/phpBB2/viewtopic.php?t=3228
Jean-Marc
You can see this msg
http://forums.runrev.com/phpBB2/viewtopic.php?t=3228
Jean-Marc
Thanks for your help...I got it now...after paying a bit, I also realized that when you are in the pointer tool mode and you have the graphic selected, the script works differently than when the graphic is not selected...it uses the irregular edge of the actual graphic instead of the rect boundary when the graphic in not selected.
howeyb