How to determine if a rectangle was intersected by any other rectangle in a form C# not XNA
I want to determine if a rectangle is intersected by any other rectangle in the form in C# not in XNA.
So here's a scenario. Rectangles A and B change location random开发者_开发技巧ly (using a timer) in the form while Rectangle C is static. None of the rectangles should know about each other so
if (RectA.IntersectsWith(RectB))
{
MessageBox.Show("KAPOW");
}
is not ideal...
Cheers for any help you can give me.
What's wrong with System.Drawing.Rectangle.InterectsWith() method?
精彩评论