首页 > 其他 > 详细

CCLablettf读取显示xml文件内容显示中文

时间:2017-01-09 12:50:09      阅读:277      评论:0      收藏:0      [点我收藏+]
  1. CCDictionary *strings = CCDictionary::createWithContentsOfFile("tips2.xml");
  2. const char *hello = ((CCString*)strings->valueForKey("tp1"))->m_sString.c_str();
  3. CCLabelTTF *labelHello = CCLabelTTF::create(hello, "fonts/Microsoft YaHei.ttf", 40);
  4. labelHello->setPosition(ccp(100, 100));
  5. labelHello->setAnchorPoint(ccp(0.5, 0.5));
  6. //设置居中对齐
  7. labelHello->setHorizontalAlignment(kCCTextAlignmentLeft);
  8. labelHello->setPosition(ccp(267,182));
  9. //设置显示框大小
  10. labelHello->setDimensions(CCSizeMake(500, 200));
  11. labelHello->setColor(ccc3(6, 48, 90));
  12. pReliveBoard->addChild(labelHello, 1);





CCLablettf读取显示xml文件内容显示中文

原文:http://www.cnblogs.com/feizuzu/p/abdd8dcaa1adf81ec4ef96e02ee312e5.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!