Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tiled Map Editor: size of isometric tile side

In Tiled editor there is an isometric map example: "isometric_grass_and_water.tmx". This example shows simple isometric map with tiles which have size 64x32 pixels.

I need to know size of the side of a tile, so I simply used Pythagorean theorem for this: enter image description here

In right-angled triangle ABC side AC = width / 2 = 32 and side AB = height / 2 = 16. Thus side of a tile (BC) can be calculated as:

enter image description here

So whole tile is a rhombus in which each side = 35.777.

However when I add an square object with dimensions 35.77 x 35.77 to the Tiled, it not fits into the grid (it is actually bigger than on tile). But if I add object with dimensions 32 x 32 - it fits perfectly.

Please take a look on this image (object A is 32x32, and B is 35.77x35x77):

enter image description here

How is this possible? Is Tiled uses some kind of scaling, or something wrong with my calculations?

like image 289
ovk Avatar asked Dec 26 '22 06:12

ovk


1 Answers

In isometric mode, the objects are projected into isometric perspective. Since Tiled normally uses pixels for object position and size in orthogonal mode, I chose to use a virtual pixel grid that is projected onto the isometric plane. This grid uses the tile height as the number of subdivisions of the tile grid, hence an object with its width and height equal to the tile height will fill exactly one tile.

My apologies that this has never been documented properly. I will get to the documentation once all the features are in!

like image 54
Thorbjørn Lindeijer Avatar answered Jan 12 '23 20:01

Thorbjørn Lindeijer