cocos2dx 2.0-3.0 过渡篇

前端之家收集整理的这篇文章主要介绍了cocos2dx 2.0-3.0 过渡篇前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
ValueMap dict = FileUtils::getInstance()->getValueMapFromFile("loading_xml.xml");
        std::string pStrLoading = dict.at("loading_now").asString();
        Label * pLabelLoading = Label::createWithSystemFont(pStrLoading,"Arial",10);
        CC_BREAK_IF(pLabelLoading==NULL);
        pLabelLoading->setPosition(pProLoadRec->getPosition());
        addChild(pLabelLoading,enZOrderMid+2,enTagLabel);



CCDictionary *pDicLang = CCDictionary::createWithContentsOfFile("ui_xml/loading_xml.xml");
		CC_BREAK_IF(pDicLang==NULL);

		//加载信息label
		CCString *pStrLoading = dynamic_cast<CCString*>(pDicLang->objectForKey("loading_now"));
		CCLabelTTF * pLabelLoading = CCLabelTTF::create(pStrLoading->m_sString.c_str(),10);
		CC_BREAK_IF(pLabelLoading==NULL);
		pLabelLoading->setPosition(pProLoadRec->getPosition());
		addChild(pLabelLoading,enTagLabel);

<?xml version="1.0" encoding="UTF-8"?>
<plist>
<dict>

  <!--正在加载 -->
  <key>loading_now</key>  
  <string>正在加载配置......</string>
  <!--加载完成 -->
  <key>loading_end</key>
  <string>加载配置完成</string>

</dict>

</plist>



-------------------------------------------------------------------

原文链接:https://www.f2er.com/cocos2dx/346212.html

猜你在找的Cocos2d-x相关文章