我正在使用JSTileMap将TMX磁贴地图加载到sprite工具包中,问题是如果我使用tileSet.png,磁贴在显示时会显得太大。如果我使用tileSet@2x.png,那么tiles显示的大小是正确的,但是我的tmx map不能正确显示,相反,我看到的只是网格中的tileSet。我曾尝试将tileSet@2x.png重命名为tileSet.png,但磁贴看起来又一次太大。
我可以在JSTileMap中使用tileSet@2x.png吗?
两个png文件中的平铺均为128x128
任何帮助都是非常感谢的。
发布于 2014-08-23 00:15:11
听起来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,我会看一看。
https://stackoverflow.com/questions/25395576
复制相似问题