On Mon, 9 Aug 1999, Dave Cragg wrote:

> At 2:02 PM -0700 9/8/1999, Karl Becker wrote:
> >Okay, here's my big question:  how is it the easiest (and quickest, for
> >that matter) way to find out if a point is not just within the rectangle
> >of a polygon, but also within the individual points?  I'd just be working
> >with closed polys, and would just need to find out if one point is within
> >the poly (2D, a graphic) .  Thanks much in advance!  Hope this hasn't
> >been covered before here, since I'm relatively new to the list...
> 
> If the polygons are filled (the "filled" property set to true), then 
> the within() function will return true for points within the polygon.
> 
> If they're not filled, I'm not sure. There was some discussion 
> recently on the Hypercard list about calculating this. The underlying 
> principle was that if a straight line extended from the point crosses 
> an even number of the polygon's sides then the point must be outside. 
> If it crosses an odd number, then it's inside. Which leads me to 
> believe that filled polygons are the way to go. :))

Correct.  You can use within(), the target(), and the mouseControl()
with these.  If you don't want to see the fill, set the ink of the
graphic to "noop" using the color chooser.
  Regards,
    Scott

> Cheers
> Dave Cragg
> 
> _____________________________________________
> The LACS Centre (Business English Training Resources)
> mailto:[EMAIL PROTECTED]
> http://www.lacscentre.co.uk
> _____________________________________________
> 

********************************************************
Scott Raney  [EMAIL PROTECTED]  http://www.metacard.com
MetaCard: You know, there's an easier way to do that...

Reply via email to