本文整理汇总了C++中LabelTTF::setFontFillColor方法的典型用法代码示例。如果您正苦于以下问题:C++ LabelTTF::setFontFillColor方法的具体用法?C++ LabelTTF::setFontFillColor怎么用?C++ LabelTTF::setFontFillColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LabelTTF
的用法示例。
在下文中一共展示了LabelTTF::setFontFillColor方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: add_option
void MyListView::add_option(const char* name)
{
Sprite* option = Sprite::create("situ_item_background_normal.png");
option->setPosition(0,-options_vec.size()*option_height-option_height);
option->setCascadeOpacityEnabled(true);
option->setOpacity(0);
LabelTTF* label = LabelTTF::create(name,"Arial",50);
label->setFontFillColor(Color3B(249,222,144));
label->setPosition(option->getBoundingBox().size.width/2,option->getBoundingBox().size.height/2);
option->addChild(label);
this->addChild(option);
this->options_vec.pushBack(option);
if(options_vec.size()*option_height+option_height>height)
{
height = options_vec.size()*option_height+option_height;
}
}
示例2: initPropList
void LevelStartView::initPropList(cocos2d::Layer * pStart)
{
std::vector<std::string> propList;
getPropListData(propList);
size_t i = 0;
for (std::map<std::string, std::string>::iterator it = m_propList.begin(); it != m_propList.end(); ++it)
{
Sprite* pPropList = static_cast<Sprite *>(pStart->getChildByName(propList.at(i++)));
Size s = pPropList->getContentSize();
Sprite* pProp = Sprite::create(it->first);
pProp->setScale(1.2f);
pProp->setPosition(s.width / 2, s.height / 2);
pProp->setTag(i + 1);
pPropList->addChild(pProp);
LabelTTF* propFee = LabelTTF::create(it->second, "fonts/Marker Felt.ttf",36);
propFee->setFontFillColor(ccc3(126, 126, 126));
propFee->setPosition(s.width-20, -s.height/2+20);
pPropList->addChild(propFee);
auto listener = EventListenerTouchOneByOne::create();
listener->setSwallowTouches(true);
listener->onTouchBegan = CC_CALLBACK_2(LevelStartView::onTouchBegan, this);
listener->onTouchMoved = CC_CALLBACK_2(LevelStartView::onTouchMoved, this);
listener->onTouchEnded = CC_CALLBACK_2(LevelStartView::onTouchEnded, this);
this->getEventDispatcher()->addEventListenerWithSceneGraphPriority(listener, pProp);
}
}