It seems I'm geometry-challenged today -- I know this should be simple, but
I'm stumped:
I can draw a line object from the loc of one object to the loc of another.
But if I want to draw only in the space _between_ objects rather than
intersect them, how do I get the points for the location where a line object
would meet the edge of the other objects if drawn all the way to their
centers, as indicated by the "X"s below:
----------------- | | | button1 | | \ | ----------X------ \ \ ------X---------- | \ | | button2 | | | -----------------
Try something like this:
on mouseUp put item 1 of loc of button 2 - item 1 of loc of button 1 into tDeltaX put item 2 of loc of button 2 - item 2 of loc of button 1 into tDeltaY put atan2(tDeltaY, tDeltaX) into tRadianAngle put tRadianAngle * (180/pi) into tDegreeAngle put tDegreeAngle into field 1
put ((width of button 1/2) * cos(tRadianAngle)) + item 1 of loc of button 1 into tNewX
put ((height of button 1/2) * sin(tRadianAngle)) + item 2 of loc of button 1 into tNewY
set loc of graphic 1 to tNewX,tNewY
put cr & tNewX & ":" & tNewY after field 1
end mouseUp
You will need to add a buffer into tNewX and tNewY to get outside the button
-- Trevor DeVore Blue Mango Multimedia [EMAIL PROTECTED]
_______________________________________________ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
