請告訴我如何在要添加圖塊的圖層上展示Tilemap? 翻遍所有的文件,沒有找到。如何刪除瓷磚層,我意識到:cocos2d/cocos2d-x:將圖層添加到圖層
[_meta removeTileAt:tileCoord];
如何添加瓷磚層?請提示。通常我需要成爲一個障礙選擇瓷磚。
請告訴我如何在要添加圖塊的圖層上展示Tilemap? 翻遍所有的文件,沒有找到。如何刪除瓷磚層,我意識到:cocos2d/cocos2d-x:將圖層添加到圖層
[_meta removeTileAt:tileCoord];
如何添加瓷磚層?請提示。通常我需要成爲一個障礙選擇瓷磚。
我相信在cocos2d-x中有一個叫做CCTMXTiledMap
的類。通過
map = CCTMXTiledMap::create("stonemap.tmx");
CCTMXLayer x=map->layerNamed("layer_name")
//layer_name is name you give to your layer Ex...backGround_Layer,Obstacle_Layer
一般我需要成爲一個障礙選擇瓷磚。 – user3079929
你可以做到這一點...其中m_gid是你的資源ID :)
:你可以像這樣在cocos2d-x在CCLayer
添加地圖
layer->setTileGID(m_gid, tileCoord);
得到的答案從here
map = CCTMXTiledMap::create("stonemap.tmx");
this->addChild(map,0,tagMap);
請說明完整的問題 – Jain