System.Drawing.Rectangle.IntersectsWith C# (CSharp) Method

IntersectsWith() public method

public IntersectsWith ( System rect ) : bool
rect System
return bool
        public bool IntersectsWith(System.Drawing.Rectangle rect) { throw null; }
        public void Offset(System.Drawing.Point pos) { }

Same methods

Rectangle::IntersectsWith ( Rectangle rect ) : bool

Usage Example

Example #1
0
 private void SearchIntersections() // scans if the ball is intersecting with anything
 {
     for (int i = 0; i < 60; i++)
     {
         if (pingBall.IntersectsWith(bricks[i]) && brickExists[i] == true)
         {
             //rectangleGraphics.FillRectangle(blackBrush, bricks[i]);
             brickExists[i] = false;
             // write code to detect specific wall; WallRebound(0/1/2/3);
             System.Drawing.Rectangle leftSide = new System.Drawing.Rectangle(bricks[i].Left, bricks[i].Top, 1, 25);
         }
     }
     if (pingBall.Left < 0)
     {
         runningVelocity[1] *= -1;
     }
     if (pingBall.IntersectsWith(topWall))
     {
         runningVelocity[0] *= -1;
     }
     if (pingBall.Right > 450)
     {
         runningVelocity[1] *= -1;
     }
     if (pingBall.IntersectsWith(bottomWall))
     {
         YouDroppedTheBallOnThisOne();
     }
     if (pingBall.IntersectsWith(paddle))
     {
         CurryRebound();
     }
 }
All Usage Examples Of System.Drawing.Rectangle::IntersectsWith