cocos2dx V2.3.3 중국어 난자 해결

956 단어

cocos2dx VS2010             ,            。    ,        ,              。

1. Resources에 새 xml 파일을 만들고utf-8로 인코딩하는 것을 기억하세요. 내용은 다음과 같습니다.
        
<dict>
  <key>str_action</key>
  <string>  </string>
  <key>str_sprite</key>
  <string>  </string>
  <key>str_scene</key>
  <string>  </string>
</dict>

 
2. 중국어를 표시할 곳에서 다음 코드를 호출합니다.
    
//       XML
	 CCDictionary *chnStrings = CCDictionary::createWithContentsOfFile("string_HelloWorldScene.xml"); 
	 //  
	 const char *str_action=((CCString*)chnStrings->objectForKey("str_action"))->m_sString.c_str();//     Key  
	 auto lb_action=CCLabelTTF::create(str_action,"Arial",35); //  label

 

좋은 웹페이지 즐겨찾기