首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >雪碧图套件中的TileMap磁贴大小问题

雪碧图套件中的TileMap磁贴大小问题
EN

Stack Overflow用户
提问于 2014-08-20 09:50:11
回答 1查看 722关注 0票数 0

我正在使用JSTileMap将TMX磁贴地图加载到sprite工具包中,问题是如果我使用tileSet.png,磁贴在显示时会显得太大。如果我使用tileSet@2x.png,那么tiles显示的大小是正确的,但是我的tmx map不能正确显示,相反,我看到的只是网格中的tileSet。我曾尝试将tileSet@2x.png重命名为tileSet.png,但磁贴看起来又一次太大。

我可以在JSTileMap中使用tileSet@2x.png吗?

两个png文件中的平铺均为128x128

任何帮助都是非常感谢的。

EN

回答 1

Stack Overflow用户

发布于 2014-08-23 00:15:11

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

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

代码语言:javascript
复制
<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,我会看一看。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/25395576

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档