How detect the object over other object is?

James Hurley jhurley0305 at sbcglobal.net
Mon Dec 20 14:39:24 EST 2010


>
> Message: 14
> Date: Sun, 19 Dec 2010 23:41:05 -0800 (PST)
> From: JosepM <jmyepes at mac.com>
> To: use-revolution at lists.runrev.com
> Subject: Re: How detect the object over other object is?
> Message-ID: <1292830865948-3095145.post at n4.nabble.com>
> Content-Type: text/plain; charset=us-ascii
>
>
> Yes, but I need to check for each, isn't other way to do?
>
>
> Salut,
> Josep
> --  
> View this message in context: http://runtime-revolution.278305.n4.nabble.com/How-detect-the-object-over-other-object-is-tp3094859p3095145.html
> Sent from the Revolution - User mailing list archive at Nabble.com.
>


With a slight variation on Craig's solution you can get a list of all  
controls intersecting all others with

on mouseup
    put the number of controls into N
    repeat with i = 1 to N
       repeat with j = i+1 to N
          put intersect(control i, control j) into theyIntersect
          if theyIntersect then put the id of control i &  " interects  
"  & the id of control j & cr after tList
       end repeat
    end repeat
    answer tList
end mouseup

Although the following is redundant (that is if a intersects b, then b  
intersect a) it may be useful as well:

on mouseup
    put the number of controls into N
    repeat with i = 1 to N
       repeat with j = 1 to N
          if i = j then next repeat --Self intersection
          put intersect(control i, control j) into theyIntersect
          if theyIntersect then put the id of control i &  " interects  
"  & the id of control j & cr after tList
       end repeat
    end repeat
    answer tList
end mouseup




More information about the use-livecode mailing list