Hi, I have a rectangle inside another rectangle, how can I make to do like an IntersectWith method but just the outer rectangle Border?

Since one rectangle is inside the other it seems like it is always intersecting so I want to know how to tell the inner rectangle to do something only if it intersects with the outter rectangle border.

Edited by MrCapuchino: n/a

2
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by Rynkadink

I belive you have the coords/position of one vertex of each rectangle; Having this and the lenght of the sides it's quite simple, I guess.
Taking as reference the top left vertex of the outter rectangle and comparing with the position of the top left vertex of the inner rectangle (considering the sides lenght) you are able to know if the edges are intersecting.

Ok,

Yeah that will work, I thought I might find a method that did that for me, just in case I resized the rectangles but that will work

Thanks

Just an idea; Don't know if there's a method defined for that too .. =)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.