1 hour ago, kseh said:
You have not actually posted a question or otherwise indicated what you are having problems with.
I don't have experience working with hexagon grids and it isn't something I can invest the time investigating to be able to provide any suggestions. In general, I would expect it to be much more difficult than a square tile based project. But if you just wanted to print out a grid, you have code to do that which you can examine to try and understand what's going on.
I am trying to draw a whole screen of hexes , I am able to draw only one hex here is my already posted code
private void Form1_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
Pen whitePen = new Pen(Color.White, 1);
float height = 50.0f;
float width = (float)(4 * (height / 2 / Math.Sqrt(3)));
float y = height / 2;
float x = 0;
float row = 0.0f;
y += row * height;
float col = 1.0f;
if (col % 2 == 1)
{
y += height / 2;
}
x += col * (width * 0.75f);
PointF pt1 = new PointF(x, y);
PointF pt2 = new PointF(x + width * 0.25f, y - height / 2);
PointF pt3 = new PointF(x + width * 0.75f, y - height / 2);
PointF pt4 = new PointF(x + width, y);
PointF pt5 = new PointF(x + width * 0.75f, y + height / 2);
PointF pt6 = new PointF(x + width * 0.25f, y + height / 2);
g.DrawLine(whitePen, pt1, pt2);
g.DrawLine(whitePen, pt2, pt3);
g.DrawLine(whitePen, pt3, pt4);
g.DrawLine(whitePen, pt4, pt5);
g.DrawLine(whitePen, pt5, pt6);
g.DrawLine(whitePen, pt6, pt1);
whitePen.Dispose();
g.Dispose();
}