示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
 protected override void LoadContent()
 {
     spriteBatch = new SpriteBatch(GraphicsDevice);
     superBatch  = new SuperBatch(spriteBatch, GraphicsDevice, camera);
 }
示例#4
0
 public static void FillBounds(SuperBatch sb, Bounds bounds, Color color)
 {
     sb.Draw(pixel, bounds.ToRectangle(), color);
 }
示例#5
0
 public static void DrawPoint(SuperBatch sb, Vector2 point, Color color)
 {
     sb.Draw(pixel, point, color);
 }