Tiled Map Editor: size of isometric tile side

我的未来我决定 提交于 2019-12-09 19:58:20

问题


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:

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:

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):

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


回答1:


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!



来源:https://stackoverflow.com/questions/24747420/tiled-map-editor-size-of-isometric-tile-side

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!