HexMapLibrary icon indicating copy to clipboard operation
HexMapLibrary copied to clipboard

Tile Size

Open Ziboo opened this issue 7 years ago • 1 comments

Hi,

I have a new issue.. I was wondering if we can set the scale of a tile somewhere. Right now it assumes that a tile is 1 meter radius I think, but I would like to have bigger tiles. But all the functions to retrieve the Cartesian coordinates will be wrong if I just scale my model.

Any chance to have this feature ?

Thanks

Ziboo avatar Sep 04 '18 16:09 Ziboo

I'm on holidays right now, so just a short answer for now. For now the library indeed does only work on a fixed scale with a radius of 1 unit. First of all you should consider if you really need bigger tiles or can just change your camera and the scale of your gameobjects, keeping things to a scale of 1 makes things easier in a lot of ways. If you really need to do it, you should be able to rescale the values quite simply though.

if you for example have a scale of 2 then you can just multiply the cartesian coordinate of a tile by 2 - or if you have the position of a gameObject and want to have its tileCoordinate you divide the position of the gameObject by 2 and then convert this result from cartesian to tile coordinate.

I'll look into how much effort it is to add a direct support for different tile sizes when I'm home. It is easy to do, but doing it cleanly so everything stays as simple as possible might take a bit.

AurelWu avatar Sep 07 '18 19:09 AurelWu