- 博客(0)
- 资源 (8)
- 收藏
- 关注
cocos2d-x 读取xml
在cocos2d-x 中读取xml文件
用法:
XMLParser *pXmlParser = XMLParser::parseWithFile("strings.xml");
CCString *pValue1 = pXmlParser->getString("hello");
CCString *pValue2 = pXmlParser->getString("name");
CCString *pValue = CCString::createWithFormat("%s%s%s%s", "XML: ", pValue1->getCString(), ",", pValue2->getCString());
CCLabelTTF* pLabel = CCLabelTTF::create( TextUtil::a2u(pValue->getCString()).c_str() , "Arial", 30);
pLabel->setColor(ccGREEN);
pLabel->setPosition(ccp(size.width / 2, size.height - 30));
this->addChild(pLabel, 1);
2013-06-28
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人