I'm adding a CCTMXTiledMap to my Android project but it's not showing on the screen.
This is what I tried. I created the map with Tiled, changed the compression in Base64 gzip to get rid of the indexOutOfBounds issue, and loading it with this generic code:
CCTMXTiledMap map = CCTMXTiledMap.tiledMap("sewer.tmx");
addChild(map);
I also tried different values in the addChild method, such as
addChild(map, 0)
or -1, or 1, but no luck.
Here's some debug data:
map = <instance of class org.cocos2d.layers.CCTMXTiledMap| Tag = -1>
map bounding box d=((0.0, 0.0),(768.0, 768.0))
map bounding anchor point =(0.0, 0.0)
map bounding position =(0.0, 0.0)
map bounding content size =<768.0, 768.0>
chidren =[<instance of class org.cocos2d.layers.CCTMXLayer| Tag = 0>]
My tmx file:
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.0" orientation="orthogonal" width="32" height="32" tilewidth="24" tileheight="24">
<tileset firstgid="1" name="sewer_tileset_large.png" tilewidth="24" tileheight="24">
<image source="sewer_tileset_large.png" trans="ff00ff" width="1920" height="2170"/>
</tileset>
<layer name="Tile Layer 1" width="32" height="32">
<data encoding="base64" compression="gzip">
H4sIAAAAAAAAC+3BAQ0AAADCoPdPbQ8HFAAAAPBuEQAcxwAQAAA=
</data>
</layer>
The png image, sewer_tileset_large.png is in the assets folder, next to the sewer.tmx file. I noticed that in the tmx file generated by Tiled the .png extension is omitted, so I added it manually. But still no luck.
What am I missing?