Example #1
0
        public static void DrawColoredSquare(FoxDraw foxDraw)
        {
            foxDraw.StrokeColor(Colors.Blue);
            foxDraw.DrawLine(200, 200, 400, 200, 5);

            foxDraw.StrokeColor(Colors.Purple);
            foxDraw.DrawLine(200, 400, 400, 400, 5);

            foxDraw.StrokeColor(Colors.Yellow);
            foxDraw.DrawLine(200, 200, 200, 400, 5);

            foxDraw.StrokeColor(Colors.Green);
            foxDraw.DrawLine(400, 200, 400, 400, 5);
        }
Example #2
0
 public static void DrawHexagon(int xPosition,
                                int yPosition,
                                int edge,
                                Color lineColor,
                                Color shapeColor,
                                FoxDraw foxDraw)
 {
     foxDraw.FillColor(shapeColor);
     foxDraw.StrokeColor(lineColor);
     foxDraw.DrawPolygon(new List <Point>
     {
         new Point(xPosition - edge / 2, yPosition - edge * 0.866), // 0
         new Point(xPosition + edge / 2, yPosition - edge * 0.866), // 1
         new Point(xPosition + edge, yPosition),                    // 2
         new Point(xPosition + edge / 2, yPosition + edge * 0.866), // 3
         new Point(xPosition - edge / 2, yPosition + edge * 0.866), // 4
         new Point(xPosition - edge, yPosition),                    // 5
         new Point(xPosition - edge / 2, yPosition - edge * 0.866)  // 0
     });
 }