1

I'm porting an iPhone project written with cocos2D to Android and have run into a problem setting up the CCTMXTiledMap. I've gotten the TMX file to load correctly:

CCTMXTiledMap tileMapNode = CCTMXTiledMap.tiledMap("jungle.tmx");

and know that the layer is at least displayed on the screen with this:

CCTMXLayer background = tileMapMapNode.layerName("jungleLayer");

and here is my tmx file:

<?xml version="1.0" encoding="UTF-8"?>
 <map version="1.0" orientation="orthogonal" width="1" height="10" tilewidth="320"     tile height="480">
 <tileset firstgid="1" name="jungle" tilewidth="320" tileheight="480">
 <image source="../workspace/Copy of HelloAndroid/assets/jungle.png" width="320" height="480"/>
 </tileset>
  <layer name="jungleLayer" width="1" height="10">
   <data encoding="base64" compression="gzip">
   H4sIAAAAAAAAC2NkYGBgJAIDALBnLoYoAAAA
  </data>
 </layer>
</map>

I've got the jungle.png file in the assets folder of the right project, but when I load the tileMapNode onto the screen, it shows up as a solid white sprite where it should show the layer.

It may be I'm overlooking something simple, but any help would be appreciated.

mknutso2
  • 47
  • 8

1 Answers1

0

I had the same problem. To work here, I put the .tmx and the .png file at the folder Assets. In your line: <image source="../workspace/Copy of HelloAndroid/assets/jungle.png" width="320" height="480"/>

Do like that:

<image source="jungle.png" />

That´s it.

Luck
  • 1