Message: 14
Date: Sun, 19 Dec 2010 23:41:05 -0800 (PST)
From: JosepM <jmye...@mac.com>
To: use-revolut...@lists.runrev.com
Subject: Re: How detect the object over other object is?
Message-ID: <1292830865948-3095145.p...@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

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to