Search code examples
cocos2d-xtiled

cocos2d-x tiledMap create return null?


I am currently following Ray's tutorial on cocos2d-x tile map and my very simple code is not working at all.

So here is my code,

_tileMap = TMXTiledMap::create("TileMap.tmx");

this->addChild(_tileMap);

and according to the debugger, _tileMap is null, which causes a crash on the addChild method.

Do anyone have any idea why this is happening?

p.s _tileMap is declared as a TMXTiledMap* in header, TileMap.tmx is totally filled with stuff and TileMap.tmx along with other things are imported into the resource folder using creating folder reference.


Solution

  • Have you try "Tile layer format" with "Base64(uncompressed) ?

    I have same symptom as like you, but I get out from stock by change tile layer format from cvs to Base64(uncompressed).

    enter image description here