Overlap detection?

Alan Stenhouse alanstenhouse at hotmail.com
Sun Feb 1 06:58:45 EST 2015


Hi Richmond

You’ll want to use the optional threshold parameter for the intersect function.

intersect(object,object [,threshold] )

Probably in your case either “pixels” or “opaque pixels”!

From the Dictionary:

Use the intersect function to determine whether one object obscures part of another object, or whether one object is over another object.
Parameters:
object - an object reference.   
threshold - The amount of transparency that pixels in the objects must have in order to be counted during the intersect calculation.  
•	alpha value - An integer between 0 and 255 which specifies a threshold that the alpha value of each pixel must be greater than or equal to in order to be counted during calculation of the intersect.
 
Alternative (readable) theshold options
•	"bounds" - (Equivalent to using an alpha value of 0) Specifies that the intersect is calculated using the rect of the two objects.
•	"pixels" - (Equivalent to using an alpha value of 1) Specifies that the intersect is calculated using pixels of the objects that have are not completely transparent, ignoring completely transparent areas.
•	"opaque pixels" - (Equivalent to using an alpha value of 255) Specifies that the intersect is calculated using only pixels that are completely opaque.
  

HTH!

cheers

Alan

--
Alan Stenhouse
alanstenhouse at hotmail.com

Check out our apps on the App Store:

BeatSpeak - the multilingual talking metronome
EV-Point - Find your nearest Electric Vehicle Recharge Station.
Re-Collections - Make your family history come to life. Every picture tells your story.





More information about the Use-livecode mailing list