is within ... polygon shape?
Lynch, Jonathan
bnz2 at cdc.gov
Fri Jun 24 13:24:09 EDT 2005
Yes, makes perfect sense:)
There are some situations where you might need to be that precise. At
least, I guess there are - none for anything I do. I think I see another
way to do it, without having to test against every single point in the
moving image.
-----Original Message-----
From: use-revolution-bounces at lists.runrev.com
[mailto:use-revolution-bounces at lists.runrev.com] On Behalf Of Scott
Rossi
Sent: Friday, June 24, 2005 1:16 PM
To: How to use Revolution
Subject: Re: is within ... polygon shape?
Recently, Lynch, Jonathan wrote:
>>> Put the points of image "myImage1" into field "feedback"
>>> Causes an error - it says this object does not have this property. I
>>> am misunderstanding something aren't I?
>> Images don't have points. You simply test the point against the
image
>> itself:
>> if within(img "myImage",myPoint) then answer "point is within the
>> image"
> Ah, but that only tests a single point. To be perfectly accurate, one
> would need to test every single non-transparent point in the image.
OK, let's use a golf analogy as an example. Let's say you wanted to
find
out if the ball is on the green:
if within(img "green",loc of img "ball") then answer "ready to putt"
In this case you are testing the loc point of the ball against the
opaque
region of the "green" image. There is only one point to test. You
could go
further and test all the rect points of the ball as well: topLeft,
topRight,
etc but this depends on how precise you want to be.
Does this make sense?
Regards,
Scott Rossi
Creative Director
Tactile Media, Multimedia & Design
-----
E: scott at tactilemedia.com
W: http://www.tactilemedia.com
_______________________________________________
use-revolution mailing list
use-revolution at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
More information about the use-livecode
mailing list