富文本的作用:组合不同颜色的字体信息;组合文字和图片信息
#include "UIRichText.h"//引用富文本类
RichText* richText =RichText::create();
richText->ignoreContentAdaptWithSize(false);//禁止自动改变尺寸
richText->setContentSize(Size(895,0)); //设置宽高
richText->setLocalZOrder(10);
RichElementText* text1 =RichElementText::create(0,Color3B(0,255, 0), 255, "文本内容","Arial", 24);//富文本文本元素
richText->pushBackElement(text1);
RichElementText* text2 = RichElementText::create(0,Color3B(0, 255, 0), 255, "文本内容", "Arial", 24);//富文本文本元素
richText->pushBackElement(text2);
RichElementImage * image1 = RichElementImage::create(0,Color3B(0, 255, 0),255,"vip_blank.png");
richText->pushBackElement(image1);
RichElementImage * image2 = RichElementImage::create(0, Color3B(0, 255, 0), 255,"vip_blank.png");
richText->pushBackElement(image2);