Sprite工具包中的TileMap图块大小问题

时间:2014-08-20 01:50:11

标签: ios7 sprite-kit jstilemap

我正在使用JSTileMap将TMX图块地图加载到sprite工具包中,我遇到的问题是,如果我使用tileSet.png,则显示时图块显得过大。如果我使用tileSet@2x.png,则图块显示的大小正确但我的tmx图表没有正确显示,而我看到的只是网格中的tileSet。我已经尝试将tileSet@2x.png重命名为tileSet.png,但瓷砖看起来太大了。

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

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

感谢任何帮助。

1 个答案:

答案 0 :(得分: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>

如果您确定这不是问题,请提交an issue on github here,我就来看看。