Point Inside Polygon
Monte Goulding
monte at sweattechnologies.com
Sun Jun 29 22:29:00 EDT 2003
>
> There is no way to test via script if a point is inside or outside a poly
> - 'within' will return if the point is within the rect of the poly, but
> that's about it.
Hi Eric
I can see you've done some work here but the statement above is not correct.
>From the docs:
"If the point is within the clickable area of the object, the within
function returns true, even if another object is layered on top of the
object. If the object is a graphic, its interior is considered to be within
the graphic only if the graphic's filled property is true or the graphic is
selected."
So even if you have an unfilled poly you can test 'within' using the
following method:
lock screen
set the filled of grc x to true
put within(grc 1,point) into isItWithin
set the filled of grc x to false
Cheers
Monte
More information about the use-livecode
mailing list