示例#1
0
 public bool containsPoint(Vec2 point)
 {
     if (point.X >= Pos.X && point.X <= Pos.X + Size.X && point.Y >= Pos.Y && point.Y <= Pos.Y + Size.Y)
     {
         return true;
     }
     return false;
 }
示例#2
0
 public float Dot(Vec2 other)
 {
     return X * other.X + Y * other.Y;
 }
示例#3
0
 public float DistanceTo(Vec2 other)
 {
     return (float)Math.Sqrt((X - other.X) * (X - other.X) + (Y - other.Y) * (Y - other.Y));
 }
示例#4
0
 public static bool drawLine(Vec2 start, Vec2 end, ConsoleColor color)
 {
     return drawLine(start.X, start.Y, end.X, end.Y, color);
 }
示例#5
0
 public static bool drawRectTo(Vec2 pos, Vec2 endpos, ConsoleColor color)
 {
     for (float y = pos.Y; y <= endpos.Y; y++ )
     {
         drawLine(pos.X, y, endpos.X, y, color);
     }
     return true;
 }
示例#6
0
 public static bool drawRect(Vec2 pos, Vec2 size, ConsoleColor color)
 {
     for (float cliney = pos.Y; cliney <= pos.Y + size.Y; cliney++)
     {
         drawLine(new Vec2(pos.X, cliney), new Vec2(pos.X+size.X, cliney), color);
     }
     return true;
 }
示例#7
0
 public static bool drawPixel(Vec2 pos, ConsoleColor color)
 {
     return drawPixel(pos.X, pos.Y, color);
 }
示例#8
0
 public Rect(Vec2 _pos, Vec2 _size)
 {
     Pos = _pos;
     Size = _size;
 }