Search code examples
cocos2d-x

cocos2d/cocos2d-x: Adding tile to the layer


Please tell me how to Tilemap on the layer you want to add a tile? Rummaged through all the documentation and did not find. How to remove a tile layer, I realized:

[_meta removeTileAt:tileCoord];

How to add a tile layer? Prompt please. Generally I need to become an obstacle selected tile.


Solution

  • I believe there is a Class called CCTMXTiledMap in cocos2d-x. You can add map like this in cocos2d-x in CCLayer:

    map = CCTMXTiledMap::create("stonemap.tmx");
    this->addChild(map,0,tagMap);