开发者

How to determine if a rectangle was intersected by any other rectangle in a form C# not XNA

开发者 https://www.devze.com 2023-02-09 23:10 出处:网络
I want to determine if a rectangle is intersected by any other rectangle in the form in C# not in 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?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号