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; }
public float Dot(Vec2 other) { return X * other.X + Y * other.Y; }
public float DistanceTo(Vec2 other) { return (float)Math.Sqrt((X - other.X) * (X - other.X) + (Y - other.Y) * (Y - other.Y)); }
public static bool drawLine(Vec2 start, Vec2 end, ConsoleColor color) { return drawLine(start.X, start.Y, end.X, end.Y, color); }
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; }
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; }
public static bool drawPixel(Vec2 pos, ConsoleColor color) { return drawPixel(pos.X, pos.Y, color); }
public Rect(Vec2 _pos, Vec2 _size) { Pos = _pos; Size = _size; }