码迷,mamicode.com
首页 > 编程语言 > 详细

Cocos2d-x3.3Final(9)RichText常用成员函数(C++)

时间:2015-02-05 18:22:53      阅读:194      评论:0      收藏:0      [点我收藏+]

标签:

RichText  * _richText = RichText::create();

RichElementText * re1 = RichElementText::create(1, Color3B::RED, 255, str1, "Marker Felt", 10);

RichElementText * re4 = RIchElementText::create(4, Color3B::GREEN, 255, "And green with TTF support. ", "fonts/Marker Felt.ttf", 10);

RichElementImage * reimg = RichElementImage::create(6, Color3B::WHITE, 255, "sliderballnormal.png");


cocostudio::ArmatureDataManager::getInstance()->addArmatureFileInfo("100/100.ExportJson");

cocostudio::Armature * pAr = cocostudio::Armature::create("100");

pAr->getAnimation()->play("Animation1"); //创建骨骼动画


RichElementCustomNode * recustom = RichElementCustomNode::create(1, Color::WHITE, 255, pAr); //构造富文本元素


_richText->pushBackElement(re1);

_richText->insertElement(re2, 1);

_richText->insertElement(reimg, 2);

_richText->pushBackElement(recustom);


_richText->setLocalZOrder(10);

addChild(_richText);


_richText->ignoreContentAdaptWithSize(true); //是否忽略当前内容适应大小,为true则 不管_richText的大小,按照默认的渲染器的大小进行渲染。

Cocos2d-x3.3Final(9)RichText常用成员函数(C++)

标签:

原文地址:http://blog.csdn.net/lightupheaven/article/details/43530621

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!