0

我正在使用 JSTileMap 将 TMX 平铺贴图加载到精灵工具包中,我遇到的问题是,如果我使用 tileSet.png,平铺在显示时显得太大。如果我使用 tileSet@2x.png 瓷砖显示正确的大小,但我的 tmx 地图没有正确显示,而是我看到的只是网格中的 tileSet。我尝试将 tileSet@2x.png 重命名为 tileSet.png,但瓷砖再次显得太大。

我可以将 tileSet@2x.png 与 JSTileMap 一起使用吗?

两个 png 文件中的图块都是 128x128

任何帮助表示赞赏。

4

1 回答 1

0

听起来您的 TMX 地图中的图块大小设置为点,而不是像素。在文本编辑器中打开您的 TMX 地图文件并检查以确保所有数字都以像素为单位,而不是点。

这是您将看到的一些 XML 的示例。

<map version="1.0" orientation="orthogonal" width="78" height="30" tilewidth="16" tileheight="16">
 <tileset firstgid="1" name="Peacesong_smallProps" tilewidth="16" tileheight="16">
  <image source="Peacesong_smallProps.png" width="208" height="128"/>
 </tileset>
 <tileset firstgid="105" name="Peacesong_mediumProps" tilewidth="32" tileheight="32">
  <image source="Peacesong_mediumProps.png" width="96" height="64"/>
 </tileset>
 <tileset firstgid="111" name="Peacesong_largeProps" tilewidth="48" tileheight="48">
  <image source="Peacesong_largeProps.png" width="384" height="96"/>
 </tileset>
...
</map>

如果您确定这不是问题,请在 github 上提交问题,我会看看。

于 2014-08-22T16:15:11.137 回答