求教关于tmx地图的问题

导入JSON格式的TMX地图的问题._construct2吧_百度贴吧
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&签到排名:今日本吧第个签到,本吧因你更精彩,明天继续来努力!
本吧签到人数:0成为超级会员,使用一键签到本月漏签0次!成为超级会员,赠送8张补签卡连续签到:天&&累计签到:天超级会员单次开通12个月以上,赠送连续签到卡3张
关注:2,165贴子:
导入JSON格式的TMX地图的问题.收藏
是否可以用ajax加载然后TMXimporter2直接加载ajax.lastdate,类似这样的方式?
已经成功导入,之前的问题是layer命名的问题,多谢彩虹大大给出这么好的插件
不知道为什么,我用这个插件当画面卷动时会产生网格状的闪烁
以下是我在debug模式下测试的截图在非原始尺寸下,图像会发生不同程度的“缝隙”,官方的tile 貌似有一定改善另外我注意到用tmx的图实际上是生成了N个sprite,此图生成了400个sprite,如果地图比较大,不知道是否影响效能?比如一张的地图最少也要生成4096个sprite。
会对效能有影响, 大型地图最好还是用tilemap.但是tilemap没有frame动画. 这部分要做取舍.最好的解法还是看有没有自动产生/消除物件的功能, 只保留一定范围内的物件.当然现在还没有这功能.
这个tmx importer主要是算好格子的距离, 在格子定点上产生sprite. 其他的就是sprite的事了.
应该可以把大地图做成多个json文件后进入房间,或者走出区域时再调用新建避免太大的开放性地图,效能就应该没什么问题了.
登录百度帐号推荐应用author: description: Load and display TMX tilemaps in a Starling gamecompatible: v1.3homepage: download: Edit
This extension is based on the one created by , and allows a starling game to load and display a TMX Tilemap created using
The major contributions include:
Compatible with Starling v1.3
Target is Tiled v0.9.0
Ability to use tilesets with margins and spacing
Improved performance by using flattened sprites
Added support for properties
Added support for Objects and ObjectGroups
more to come…
This extension is still under development. If you want to contribute, feel free to help out at GitHub:
Known issues:
Can't load tilemaps that use a TSX tileset
There is an example project included with the extension. Here's an example:
Loading your tilemap using embedded assets and displaying it:
[Embed(source=&../../../../assets/example.tmx&, mimeType=&application/octet-stream&)]
private static var exampleTMX:;
[Embed(source = &../../../../assets/tmw_desert_spacing.png&)]
private static var exampleTileSet:;
var mapXML: = (new exampleTMX());
var tilesets:Vector.&Bitmap& = new Vector.&Bitmap&();
tilesets.push((new exampleTileSet()));
var mapTMX:TMXTileMap = TMXTileMap.createMap(mapXML, tilesets);
for (var i: = 0; i & mapTMX.layers.length; i++)
addChild(mapTMX.layers[i].layerSprite);
08:42: Added support for Objects and Properties
11:44: Updated examples.
00:54: Removed dynamic map loading. Added support for other TMX object types.
15:48: First public version
Source Code
All source code is avaliable at
Feel free to edit this part of the page!
extensions/tmx_maps.txt · Last modified:
14:05 (external edit)
Old revisions
Powered byTiled Map Editor
Your , easy to use and flexible tile&map&editor.
Please support my work on Tiled! -
- Second goal: Work on Tiled for two full days a week.
The terrain tool automates placement of transition tiles. This example uses tiles from the
(CC-BY-SA 3.0 & GPLv3).
Efficient tile editing tools like stamp, fill and terrain brushes.
Demonstrating support for custom objects alongside a tile map with background image. Graphics from
Rectangle, ellipse, polygon and image objects can be placed with pixel precision.
An isometric map with a custom object, showing object shapes are projected as well. The tiles are by
(CC-BY 3.0).
Supports orthogonal, isometric and hexagonal maps.
Recent News
27 June 2017
13 June 2017
24 May 20171940人阅读
cocos2d-x常见问题(9)
1.cocos2d-x 加载tmx图片失败 &
& & &&重新编译运行时加载出错,提示“TMX: Only 1 tilset per layer is supported”。原来是同一个图层上只能使用同一图块资源的元素,必须要新建一个图层,将新添加的元素布局到新图层上面,重新加载就OK了!
2.加载代码时出现程序崩溃问题
修改如下:
& & &&编辑&参数&通用&另存为数据层&Base64(zlib压缩)&
& & &&编辑&参数&通用&另存为数据层&Base64(gzip压缩)
若出现提示:&Get date from file(...hexa-test.png) failed!&,就要把原始文件(用来创建新图块的图片)放进去项目里。
1) cocos2d-x好像对tmx中使用bmp图片不支持。
2) tmx不支持同“层”添加不同“图块”,但“图块”可以添加到不同“层”。&
&&相关文章推荐
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:419385次
积分:5782
积分:5782
排名:第4319名
原创:150篇
转载:15篇
评论:153条
阅读:12580
文章:19篇
阅读:39473
阅读:25389
文章:24篇
阅读:35941
(9)(1)(4)(1)(1)(3)(4)(2)(1)(5)(5)(8)(2)(15)(21)(16)(35)(10)(22)温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!&&|&&
LOFTER精选
网易考拉推荐
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
上找到这位老兄的文章,确实不错,但是有些小地方,没接触过的话,很懵懂的在生成tilemap的那3个文件的时候,出了一大堆错误最后找到方法了】下载源码,最新的,里面的 &\libgdx-0.9.3\extensions\sources下的gdx-tiled-preprocessor-sources.jar解压了然后自己组建一个项目 &如下图 &从这个项目导出jar文件 &导出文件之后, &我为了测试,随便整了个tilemap.tmx,随便吧上一步导出的jar文件放到了这个目录下这里有个主意的地方,要吧你制作的时候用过的图片文件一并放到in文件夹下,还要建立一个导入,一个导出的文件夹&&然后控制台下输入&导出成功&本次测试需要的一个工具 制作tilemap的工具 &下面是下载地址 我已经把gdx-tiled-preprocessor打好包了,可以直接下载/file/dppeuau9这里发现一个及其蛋疼的问题 &,按照上面的方法生成tmx文件,java -jar gdx.jar in out出错了,早上还好好的能用,下午就出现这个错误&纠结啊,最后我打开tmx文件找到这句&image source="D:/Program Files/RPG Maker XP/RGSS/Standard/Graphics/Tilesets/022-SnowTown02.png" width="256" height="736"/source改成&&image source="/022-SnowTown02.png" width="256" height="736"/&&居然成了,真是无语啊!还是这个问题,源码改了提示权限不够,然后各种权限问题。到最后没办法我又发现啊,直接拖入图片出错的几率最大所以呢先简历个in文件夹,里面放入,图片 &但是 & 在导入图片不要直接拖入图片,这里要在&&地图-----&新图块.来操作我就是直接拖入才出的这蛋疼的问题
阅读(2618)|
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
历史上的今天
在LOFTER的更多文章
loftPermalink:'',
id:'fks_',
blogTitle:'关于生成tilemap的用法',
blogAbstract:'在CSDN
{if x.moveFrom=='wap'}
{elseif x.moveFrom=='iphone'}
{elseif x.moveFrom=='android'}
{elseif x.moveFrom=='mobile'}
${a.selfIntro|escape}{if great260}${suplement}{/if}
{list a as x}
推荐过这篇日志的人:
{list a as x}
{if !!b&&b.length>0}
他们还推荐了:
{list b as y}
转载记录:
{list d as x}
{list a as x}
{list a as x}
{list a as x}
{list a as x}
{if x_index>4}{break}{/if}
${fn2(x.publishTime,'yyyy-MM-dd HH:mm:ss')}
{list a as x}
{if !!(blogDetail.preBlogPermalink)}
{if !!(blogDetail.nextBlogPermalink)}
{list a as x}
{if defined('newslist')&&newslist.length>0}
{list newslist as x}
{if x_index>7}{break}{/if}
{list a as x}
{var first_option =}
{list x.voteDetailList as voteToOption}
{if voteToOption==1}
{if first_option==false},{/if}&&“${b[voteToOption_index]}”&&
{if (x.role!="-1") },“我是${c[x.role]}”&&{/if}
&&&&&&&&${fn1(x.voteTime)}
{if x.userName==''}{/if}
网易公司版权所有&&
{list x.l as y}
{if defined('wl')}
{list wl as x}{/list}}

我要回帖

更多关于 nmp转换tmx 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信