Drawing a Graphice Segment

Mike Bonner bonnmike at gmail.com
Sat Jul 25 11:02:45 EDT 2015


Would something like this work? I set up a pixel sized graphic and have it
follow the mouseloc. Set the visible of it to false so you don't see a
little dot trailing after the mouse, then use intersect to check when the
pixel is over a non-transparent part of a graphic.

on mousemove
   set the loc of grc 1 to the mouseloc -- follow the mouse around
   Repeat with i = 2 to (the number of graphics in this stack) -- the dot
is the first grc
      if intersect(grc 1,grc i,"pixels") then -- cycle through the graphics
and check for intersect
          put the long id of grc i -- if there is one, put the id into the
msg box
      else
           put empty -- else empty the msg box
      end if
   end repeat
end mousemove

I don't recall who to give credit to for this method, but i've seen it in
the forums somewhere.

On Sat, Jul 25, 2015 at 7:05 AM, Terence Heaford <t.heaford at icloud.com>
wrote:

> Thanks for the suggestion.
>
> I have tried it and sometimes it works but on other occasions not.
>
> When I display the mouseColor against the check colour sometimes they are
> different.
>
> I have assumed they are different because all the pixels in a given
> segment on the screen are not the same colour?
>
> The purpose for doing this is to try and identify the segment the mouse is
> over in a pie chart.
>
>
> > On 25 Jul 2015, at 12:37, dunbarx at aol.com wrote:
> >
> > I remember suggesting using the mouseColor function with the mouseMove
> message
>
>
> All the best
>
> Terry
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the use-livecode mailing list