Its funny the things one finds out are missing in a new framework. Silverlight 2 is missing (as far as I can tell) a rectangle intersection/collision/overlapping test function. I started writing my own and immediatly had a very nasty chunk of code. I knew I was doing something wrong. I found this short article which immediatly made me think back to college CompSci with its simple solution. I need to test if two rectangles are overlapping, but the logic is easier if I write to test if they aren’t overlapping and negate the answer. I have written an extension method in C# for the Silverlight Rect class to impliment logic similar to this. Nifty!
© 2012 JasonJackson.com · Proudly powered by WordPress & Green Park 2 by Cordobo.
Valid XHTML 1.0 Transitional | Valid CSS 3
