Пример #1
0
 public override void Draw(Canvas canvas)
 {
     for (int i = 0; i + 1 < ribbonPoints.Count; i++)
     {
         canvas.DrawLine(Color.DarkRed, 5, ribbonPoints[i] + body.Position, ribbonPoints[i + 1] + body.Position);
     }
     canvas.DrawLine(Color.DarkRed, 5, ribbonPoints[ribbonPoints.Count - 1] + body.Position, ribbonPoints[0] + body.Position);
 }
Пример #2
0
 public void Draw(Canvas canvas)
 {
     List<Vector2> vectors = shape.points;
     for (int i = 0; i + 1 < vectors.Count; i++)
     {
         canvas.DrawLine(Color.DarkOliveGreen, 5, vectors[i], vectors[i + 1]);
     }
     canvas.DrawLine(Color.DarkOliveGreen, 5, vectors[vectors.Count - 1], vectors[0]);
 }
Пример #3
0
 public static void DrawGrid(Canvas canvas, RectangleF bounds, float thickness, float lineEvery)
 {
     canvas.DrawLine(Color.Red, thickness, new Vector2(bounds.Left, 0), new Vector2(bounds.Right, 0));
     canvas.DrawLine(Color.Green, thickness, new Vector2(0, bounds.Bottom), new Vector2(0, bounds.Top));
     for (float x = -lineEvery; x >= bounds.Left; x -= lineEvery)
         canvas.DrawLine(Color.Gray, thickness, new Vector2(x, bounds.Bottom), new Vector2(x, bounds.Top));
     for (float x = lineEvery; x <= bounds.Right; x += lineEvery)
         canvas.DrawLine(Color.Gray, thickness, new Vector2(x, bounds.Bottom), new Vector2(x, bounds.Top));
     for (float y = -lineEvery; y >= bounds.Top; y -= lineEvery)
         canvas.DrawLine(Color.Gray, thickness, new Vector2(bounds.Left, y), new Vector2(bounds.Right, y));
     for (float y = lineEvery; y <= bounds.Bottom; y += lineEvery)
         canvas.DrawLine(Color.Gray, thickness, new Vector2(bounds.Left, y), new Vector2(bounds.Right, y));
 }
Пример #4
0
 public void Draw(Canvas canvas)
 {
     for(int i = 0; i+1 < boundingBox.Count; i++)
     {
         canvas.DrawLine(Color.OrangeRed, 5, boundingBox[i] + body.Position, boundingBox[i+1] + body.Position);
     }
     canvas.DrawLine(Color.OrangeRed, 5, boundingBox[boundingBox.Count-1] + body.Position, boundingBox[0] + body.Position);
 }