首页 > 代码库 > Cocos2d-X解析XML文件

Cocos2d-X解析XML文件

xml

<dict><key>1</key><string>Susake</string><key>2</key><string>游戏</string></dict>

核心代码

CCDictionary *strings = CCDictionary::createWithContentsOfFile("feature.xml");std::string str = ((CCString*)strings->objectForKey("1"))->getCString();CCLabelTTF  *labelHello = CCLabelTTF::create(str, "Arial", 24);labelHello->setPosition(300, 300);this->addChild(labelHello, 7);

 

  

Cocos2d-X解析XML文件