Change origin of isometric tilemap

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Meakin

In my current project I’m using a tilemap. While this works very good I have a minor problem: my tile data is already existing in a format I cannot change. The map described in this format expects a map has its 0|0 point at the left most edge. Godots isometric tilemap however has its 0|0 origin at the topmost edge - which results in a map rotated by 90°.

Blue: godot's tilemap origin, Red: expected tilemap origin
Blue: godot’s tilemap origin, Red: expected tilemap origin

I cannot simple rotate the tilemap object because it is a isometric map… therefore: is there a possibility to change the map origin or do I have to “rotate” the tiles during parsing of the map file?

:bust_in_silhouette: Reply From: MysteryGM

my tile data is already existing in a format I cannot change.

What kind of format is this? From my understanding all tiles are 2D images and as such can be edit at any time.
Could you elaborate or provide the file so we can see if it is possible to help you.

therefore: is there a possibility to change the map origin or do I
have to “rotate” the tiles during parsing of the map file?

Both is possible to a limited extend. Once you make the tile map you can set the origin to 3 points (Top left, Center, Bottom Left).
You will also be able to rotate the tiles by 90 degrees increments, after the tile map is made. I think this solves your problem.

The thing that bothers me is that the origin only says where a tile starts, it has no other job. So it shouldn’t be rotating your tile, only move it around.

Could you provide an example?

Okay, let me clarify:

I’m not bothered about the tiles but about the tilemap.
My tilemap is already existing in a custom text-based format, as this is an existing server-client application where I “just” rewrite the client-part. As map-creation etc. underlies an already used workflow I cannot just change the map-format. (Generally its a list of coordinates and tile-ids at these coordinate).

However this map-format assumes that the 0|0 coordinate is at the left-most point of the tilemap (assuming there are no negative coords). In godot, however, this coordinate is at the top-most point. This leads the fact that the tilemap is rotated by 90° - not the single tiles but the map itself! (Which will confuse existing players).

With the map being isometric it is not possible to rotate the map simply by 90 degrees as their width/height values are quite different.

Meakin | 2018-12-05 06:46