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, [EMAIL PROTECTED] wrote:

Subject: geometry-challenged
To: Rev Discussion List <[EMAIL PROTECTED]>
Message-ID: <[EMAIL PROTECTED]>
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:



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

Reply via email to