Exemple #1
0
 public void DrawRectangle(Bounds bounds, bool solid, Color color)
 {
     DrawRectangle(new Vector2(bounds.X, bounds.Y), bounds.Width, bounds.Height, solid, color);
 }
Exemple #2
0
 public static bool IsStriclyInside(this Vector2 point, Bounds bounds)
 {
     return !(point.X <= bounds.TopLeft.X + 1
              || point.Y <= bounds.TopLeft.Y + 1
              || point.X >= bounds.BottomRight.X - 1
              || point.Y >= bounds.BottomRight.Y - 1);
 }
Exemple #3
0
        public void Include(Bounds bv)
        {
            if (bv.TopLeft.X < TopLeft.X)
            {
                TopLeft.X = bv.TopLeft.X;
            }
            else if (bv.BottomRight.X > BottomRight.X)
            {
                BottomRight.X = bv.BottomRight.X;
            }

            if (bv.TopLeft.Y < TopLeft.Y)
            {
                TopLeft.Y = bv.TopLeft.Y;
            }
            else if (bv.BottomRight.Y > BottomRight.Y)
            {
                BottomRight.Y = bv.BottomRight.Y;
            }
        }
Exemple #4
0
 public static bool IsInside(this Vector2 point, Bounds bounds)
 {
     return !(point.X < bounds.TopLeft.X
              || point.Y < bounds.TopLeft.Y
              || point.X > bounds.BottomRight.X
              || point.Y > bounds.BottomRight.Y);
 }