将需要的字符串保存于 strings.xml文件中:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-
//Apple//DTD PLIST 1.0//EN""http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>title</key>
<string>是男人就坚持20秒</string>
<key>new_game</key>
<string>新游戏</string>
<key>setting_game</key>
<string>设置</string>
<key>quit_game</key>
<string>退出</string>
</dict>
</plist>
然后在代码中读取:CCDictionary *strings = CCDictionary::createWithContentsOfFile("fonts/strings.xml");
const char *titleStr = (CCString*)strings->objectForKey("title")->m_sString.c_str();
......