我用tiledmap生成了一个瓦片地图,为什么无法用getTileSets了呢?报错
报错信息:Uncaught TypeError: tiledMap.getTileSets is not a function, location: src/cocos2d-jsb.js:0:0
我看api文档这个函数还存在的啊。
creator版本2.4.2。
以下是tiledmap生成的tmx文件,我需要获取tileset中的碰撞信息实现阻挡物无法通过的功能,但是现在无法使用getTileSets,无法读取到里面的碰撞信息。
请问下各位是如何实现读取tileset中的碰撞信息呢?
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.2" tiledversion="1.2.0" orientation="orthogonal" renderorder="right-down" width="5" height="5" tilewidth="256" tileheight="256" infinite="0" nextlayerid="3" nextobjectid="1">
<tileset firstgid="1" name="图集" tilewidth="256" tileheight="256" tilecount="165" columns="11">
<image source="图集.png" width="3000" height="4000"/>
<tile id="14">
<objectgroup draworder="index">
<object id="1" x="12" y="8">
<polygon points="0,0 -18,119 29,219 125,216 231,190 227,92 136,-3"/>
</object>
</objectgroup>
</tile>
<tile id="15">
<objectgroup draworder="index">
<object id="1" x="35" y="52" width="160" height="154"/>
</objectgroup>
</tile>
</tileset>
<layer id="2" name="collider" width="5" height="5">
<data encoding="csv">
0,0,0,0,0,
0,15,0,0,0,
0,0,0,0,0,
0,0,0,0,0,
0,0,0,0,0
</data>
</layer>
</map>