Detect individual Collisions
in.bois at wanadoo.fr
Tue Mar 2 04:14:55 CST 2004
There is my solution
I put the following script into a hide field
set the loc of me to the mouseloc
repeat with i = 1 to the number of graphics
if intersect (me, graphic (i)) and i is not the number of me
set the textcolor of me to "green"
set the textcolor of me to "red"
Call it field 1
and i put this script into the card script or stack script
set the script of the last graphic to fld 1
and after when I create a new graphic, when it has a collision with any
object graphic it changes of color.
Le 29 févr. 04, à 12:26, jbv a écrit :
> Use the intersect fonction inside a repeat loop.
> I did something similar last year : the user was drawing
> a selection rectangle on the screen, and various objects
> were changing their bordercolor in real time if they were
> (or weren't) inside the selection rect. I was even able to
> implement multiple selection (using the shift key and
> comparing the current selection with a list of previous
> selected objects).
> Speed wasn't a roblem on a Mac 9600 / 300...
>> Hi there
>> I'm trying to make a timeline-bar where you can add or delete
>> rectangles containing "whatever". The user should be able to move a
>> rectangle left or right, but if it collides with another rectangle,
>> it should stop....
>> Because the user is able to delete and add new rectangles I have to
>> make some sort of function check if the moving rectangle is going to
>> collide with other rectangles to the left and right. (like the
>> timeline in Adobe Premiere) I know this is possible, but how do I do
>> it fast..... Checking every rectangle with repeat is to slow.....and
>> the only idea I have now is to make a list in a hidden field-table
>> for every new created rectangle......
>> any ideas....?
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
> use-revolution mailing list
> use-revolution at lists.runrev.com
More information about the use-livecode