Point in Poly

Richmond richmondmathewson at gmail.com
Wed May 29 11:25:34 EDT 2013


On 05/29/2013 05:44 PM, Devin Asay wrote:
> On May 29, 2013, at 8:17 AM, Ray Horsley wrote:
>
>> Is there a way to determine if a point is inside of a polygon graphic, and not necessarily inside the graphic's containing rectangle?

Unfortunately my feeble attempt with:

on mouseDown
   grab me
end mouseDown

on mouseStill Down
    if the loc of me is within the filled of graphic "XXX" then
      put "inside" into fld "INN"
    else
      put empty into fld "INN"
end if
end mouseStillDown

resulted in no joy as THE FILLED was invented by me :(

and, of course, 'the rect' is no use at all.

Richmond.

> Ray,
>
> Have you tried the within() function? It works the way you describe for images, but I'm not sure about graphics objects.
>
> Devin
>
>
>
> Devin Asay
> Office of Digital Humanities
> Brigham Young University
>
>
> _______________________________________________
> 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