Search code examples
delphidelphi-xe2firemonkeyhexagonal-tiles

Drawing a hexagon


Using Firemonkey XE2 , I was able to use the TCube component to create a cubed map, But I am now wanting a hexagon map. There was no option for a 3d hexagon shape i could find. I figured you could create a THex similar to the TCube but I have not been able to do this or even get close. Can anyone supply a sample of doing this?

The shape I'm looking for is a hexagon prism.

enter image description here


Solution

  • I am doing the same thing that you are doing and developing a strategic game with a hexagon map in Delphi.

    You have the object that you need in Delphi itself and that is TCylinder. You should set SubdivisionAxes from 12 to 6 (12 is default for this object) and that is all you need to have the object that you want.

    for implementing your map I suggest you to check this link as well. http://www.redblobgames.com/grids/hexagons/

    good luck.