ios - the display result of tiled map is wrong (using cocos2d-x 3.6) -
this created in tiledmap editor:
but when try display in simulator, becomes this:
you can see of tile images missed, wrong(the place dirt.png should become wall.png instead). don't know why happened. follow tutorial , add following code in helloworld project.
// create tmx map auto map = tmxtiledmap::create("tile/test.tmx"); addchild(map);
the content of test.tmx:
<?xml version="1.0" encoding="utf-8"?> <map version="1.0" orientation="orthogonal" renderorder="right-down" width="10" height="10" tilewidth="36" tileheight="36" nextobjectid="5"> <tileset firstgid="1" name="test" tilewidth="36" tileheight="36"> <tile id="0"> <image width="36" height="36" source="dirt.png"/> </tile> <tile id="1"> <image width="36" height="36" source="floor.png"/> </tile> <tile id="2"> <image width="36" height="36" source="wall.png"/> </tile> </tileset> <layer name="tile layer 1" width="10" height="10"> <data encoding="base64" compression="gzip"> h4siaaaaaaaaa2nkygbgrmmwgm7ghrnqaejmmacj4zilxs8+dbjsxoy+xo4g5fz0m0gaiqbgv49pdwgaakcoyoyqaqaa </data> </layer> <objectgroup name="object layer 1"> <object id="1" name="spawnpoint" x="125" y="133" width="67" height="62"/> </objectgroup> </map>
could 1 give me hand?
okay... have found why.... there limitations cocos2d-x support tied map editor.
in page, http://www.cocos2d-x.org/wiki/tilemap, says:
tiles: - embedded tiles not supported (i.e., tilesets embedded images). - embedded tilesets supported (i.e., tileset embedded, not images). - supports @ 1 tileset per layer.
so.... each of tilesets must contain 1 image. and... each of layer must contain 1 tilesets. if don't follow rule while editing map in tied map editor. result become chaos mine.
Comments
Post a Comment