best way to define clickable areas with irregular shapes ?

jbv jbv.silences at club-internet.fr
Fri May 25 16:47:40 EDT 2007



> Recently, Wilhelm Sanke wrote:
>
> > To my knowledge graphic objects were able to detect the mouse inside
> > their filled area - instead of their rects - long before 2.7.
>

yep, and thus the trick is actually straightforward : irregular polygonal shapes
are made with opaque graphics, and those are positioned under the background
image.
Then this very simple script can ve used in the card or background image :

on mousemove
  repeat with i=1 to number of grcs of this card
    if within(grc i,the mouseloc) then
      -- do something
      exit repeat
    end if
  end repeat
end mousemove

Best,
JB




More information about the use-livecode mailing list