I’ve made an extremely simple tileset and tilemap with Tiled 1.4.3, with one layer that has two small PNG tiles. When I try to use it in cocos2d-x-4.0 on Android, only one of those two tiles is rendered, and it’s the wrong one.
Tileset:
<?xml version="1.0" encoding="UTF-8"?> <tileset version="1.4" tiledversion="1.4.3" name="tileset" tilewidth="128" tileheight="128" tilecount="2" columns="0"> <grid orientation="orthogonal" width="1" height="1"/> <tile id="0"> <image width="128" height="128" source="tile-blue.png"/> </tile> <tile id="1"> <image width="128" height="128" source="tile-red.png"/> </tile> </tileset>
Tilemap:
<?xml version="1.0" encoding="UTF-8"?> <map version="1.4" tiledversion="1.4.3" orientation="orthogonal" renderorder="right-down" width="12" height="10" tilewidth="128" tileheight="128" infinite="0" nextlayerid="2" nextobjectid="1"> <tileset firstgid="1" source="tileset.tsx"/> <layer id="1" name="Tile Layer 1" width="12" height="10"> <data encoding="csv"> 1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,2,2,2,2,1,1,1,1, 1,1,1,2,2,2,2,2,2,1,1,1, 1,1,2,2,2,2,2,2,2,2,1,1, 1,1,2,2,2,2,2,2,2,2,1,1, 1,1,2,2,2,2,2,2,2,2,1,1, 1,1,1,2,2,2,2,2,2,1,1,1, 1,1,1,1,2,2,2,2,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1 </data> </layer> </map>
What it looks like in Tiled:
How I’m adding it in cocos2d-x:
auto map = TMXTiledMap::create("tilemap.tmx"); addChild(map);
How it’s rendering on my device: