示例#1
0
文件: Graphic.cs 项目: hgrandry/Mgx
 public void DrawRectangle(Bounds bounds, bool solid, Color color)
 {
     DrawRectangle(new Vector2(bounds.X, bounds.Y), bounds.Width, bounds.Height, solid, color);
 }
示例#2
0
文件: VectorKit.cs 项目: hgrandry/Mgx
 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);
 }
示例#3
0
文件: Bounds.cs 项目: hgrandry/Mgx
        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;
            }
        }
示例#4
0
文件: VectorKit.cs 项目: hgrandry/Mgx
 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);
 }