我可以像这样使用 CCLabelTTF,(cocos2d-x v2.1.4)
CCLabelTTF* ableText = CCLabelTTF::create("hello red blue green", "Arial", 9);
ableText->setPosition(ccp(100, 100));
ableText->setAnchorPoint(ccp(0.5, 0.5));
ableText->setColor(ccc3(100, 100, 100));
ableText->setHorizontalAlignment(kCCTextAlignmentCenter);
this->addChild(ableText, 1);
但是,我想给字符串不同的颜色。
"red" => 红色
"blue" => 蓝色
"green" => 绿色
是否可以使用一个 CCLabelTTF?