On Jan 24, 2004, at 4:46 PM, Dar Scott wrote:

On Saturday, January 24, 2004, at 04:09 PM, Trevor DeVore wrote:

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

Though this can be done without trig, getting the angle like this has the advantage of avoiding divide-by-zero problems.


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

This looks fishy to me.


I seems to me you have to figure out which side of the box the line will be crossing.

Of course, one has to figure out only one end of the problem because the other end is done the same way.

I use similar calculations for moving objects around circles and they work well. Download the test stack I posted which demonstrates it working with two buttons.



-- Trevor DeVore Blue Mango Multimedia [EMAIL PROTECTED]

_______________________________________________
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to