on mouseenter irregular shape

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
howeyb
Posts: 7
Joined: Tue Jul 21, 2009 9:42 pm

on mouseenter irregular shape

Post by howeyb » Tue Jul 21, 2009 10:03 pm

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

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1239
Joined: Sat Apr 08, 2006 1:10 pm
Contact:

Post by BvG » Wed Jul 22, 2009 9:41 am

you probably want to use the within function. for example:

Code: Select all

on mouseMove theX,theY
  if within(the long id of me,(theX, theY)) then
    --your code here
  end if
end mouseMove
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.
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

on mouseenter irregular shape

Post by jmburnod » Wed Jul 22, 2009 10:56 am

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

howeyb
Posts: 7
Joined: Tue Jul 21, 2009 9:42 pm

Post by howeyb » Wed Jul 22, 2009 2:02 pm

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

Post Reply