I am not sure how can I draw a hexagon for PolygonComponent.
I found something in doc but I don't understand what should I do for hexagon.
The PolygonComponent is the most complicated of the ShapeComponents since you’ll have to define all the “corners” of your polygon. You can create the PolygonComponent in two different ways, either you use the default constructor which takes a list of Vector2 where each of them should be between -1.0 and 1.0 that describes the ration of the length from the center to the edge of the size of the component. So [Vector2(1.0, 1.0), Vector2(1.0, -1.0), Vector2(-1.0, -1.0), Vector2(-1.0, 1.0)] would describe a rectangle that fills the full size of the component. Remember to define the list in a counter clockwise manner (if you think in the screen coordinate system where the y-axis is flipped, otherwise it is clockwise).
final vertices = ([
Vector2(0.0, 0.9), // Middle of top wall
Vector2(-0.9, 0.0), // Middle of left wall
Vector2(0.0, -0.9), // Middle of bottom wall
Vector2(0.9, 0.0), // Middle of right wall
]);
final diamond = PolygonComponent(
normalizedVertices: vertices,
size: Vector2(200, 300),
position: Vector2.all(500),
)