public static void DrawLine(SuperBatch sb, Vector2 start, Vector2 end, Color color, int thickness = 1) { float length = Vector2.Distance(start, end); float rotation = CoreFunctions.ComputeAngle(start, end); Rectangle sourceRect = new Rectangle(0, 0, (int)length, 1); sb.Draw(pixel, start, sourceRect, color, rotation); }
public static void DrawBounds(SuperBatch sb, Bounds bounds, Color color, int thickness = 1) { Bounds topBounds = new Bounds(bounds.Left, bounds.Top, bounds.Width, thickness); Bounds bottomBounds = new Bounds(bounds.Left, bounds.Bottom - thickness + 1, bounds.Width, thickness); Bounds leftBounds = new Bounds(bounds.Left, topBounds.Bottom + 1, thickness, bounds.Height - thickness * 2); Bounds rightBounds = new Bounds(bounds.Right - thickness + 1, topBounds.Bottom + 1, thickness, leftBounds.Height); FillBounds(sb, topBounds, color); FillBounds(sb, bottomBounds, color); FillBounds(sb, leftBounds, color); FillBounds(sb, rightBounds, color); }
protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); superBatch = new SuperBatch(spriteBatch, GraphicsDevice, camera); }
public static void FillBounds(SuperBatch sb, Bounds bounds, Color color) { sb.Draw(pixel, bounds.ToRectangle(), color); }
public static void DrawPoint(SuperBatch sb, Vector2 point, Color color) { sb.Draw(pixel, point, color); }