平铺的地图编辑器:等距平铺面的大小 [英] Tiled Map Editor: size of isometric tile side

查看:151
本文介绍了平铺的地图编辑器:等距平铺面的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Tiled编辑器中,有一个等轴测图示例:"isometric_grass_and_water.tmx". 此示例显示了带有尺寸为64x32像素的图块的简单等距图.

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:

在直角三角形ABC中,边AC =宽度/2 = 32,边AB =高度/2 =16.这样,瓷砖(BC)的边可以计算为:

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:

因此,整个图块都是菱形,其中每边= 35.777.

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

但是,当我向Tiled添加尺寸为35.77 x 35.77的正方形对象时,它不适合网格(实际上比在tile上大).但是,如果我添加尺寸为32 x 32的对象-完全适合.

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.

请看一下这张图片(对象A为32x32,而B为35.77x35x77):

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?

推荐答案

在等轴测模式下,对象被投影到等轴测透视图中.由于Tiled通常在正交模式下将像素用于对象位置和大小,因此我选择使用投影到等轴测平面上的虚拟像素网格.此网格使用图块高度作为图块网格的细分数量,因此宽度和高度等于图块高度的对象将恰好填充一个图块.

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!

这篇关于平铺的地图编辑器:等距平铺面的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆