odileeds/hexmaps

Add 'origin' property to HexJSON format

Opened this issue · 1 comments

sb-o commented

Currently the HexJSON format does not specify where the origin for the offset coordinate system is, and the documentation assumes that it will be at the bottom left, with the row number increasing from bottom to top).

image

However, many packages follow the offset coordinate system set out on the Red Blob Games blog, which places the origin at the top left, with r values increasing from top to bottom.

image

Could we add an 'origin' property into the specification, supporting the values "topLeft", "bottomLeft", "topRight", "bottomRight"?

This way, the file can specify which offset coordinate system has been used to compute the q and r values, and we can avoid issues where hexmaps are rendered the wrong way around when using a renderer that defaults to a different origin?

Thanks for letting me know. I'm not aware of any existing HexJSON files that use anything other than bottomLeft as the direction of the origin.

Yes, this could potentially be added. Adding it will mean that there is no HexJSON renderer in existence that can deal with the full specification.