geometry-challenged

Frank Leahy frank at backtalk.com
Sat Jan 24 17:43:19 EST 2004


If you want to do something quick and dirty for your ascii example, 
draw the line, but on each stroke, test if it's inside either button's 
rect (and don't show it if it is).

If you want something more complicated you'll have to use trigonometry. 
  For your example with button 1, you want to know the x,y coordinate of 
the intersection (X).  You know y  = button 1 y loc - 1/2 the height of 
button 1), and you can calculate x using a sine or cosine function (I 
can't remember which off the top of my head, I'd need to dig up a math 
text).  The problem with using trig is that you're going to have lots 
of cases, depending on which direction button 2 is in relation to 
button 1 (there are four quadrants you have to worry about)

Hope this helps.

-- Frank Leahy

On Saturday, January 24, 2004, at 10:00  PM, 
use-revolution-request at lists.runrev.com wrote:

> Subject: geometry-challenged
> To: Rev Discussion List <use-revolution at lists.runrev.com>
> Message-ID: <BC3822ED.3BDAA%ambassador at fourthworld.com>
> Content-Type: text/plain; charset="US-ASCII"
>
> 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:
>



More information about the use-livecode mailing list