本文整理汇总了C++中CCLabelTTF::enableStroke方法的典型用法代码示例。如果您正苦于以下问题:C++ CCLabelTTF::enableStroke方法的具体用法?C++ CCLabelTTF::enableStroke怎么用?C++ CCLabelTTF::enableStroke使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCLabelTTF
的用法示例。
在下文中一共展示了CCLabelTTF::enableStroke方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onNodeLoaded
void ChatLayer::onNodeLoaded(CCNode * pNode, CCNodeLoader * pNodeLoader)
{
m_txtAccount = CCEditBox::create(CCSizeMake(134, 30), CCScale9Sprite::create("transparent.png"));
this->addChild(m_txtAccount);
m_txtAccount->setPosition(ccp(215, 24));
m_txtAccount->setFontColor(ccc3(255,255,255));
m_txtAccount->setFont("Arial", 16);
CCMenu *menu = CCMenu::create();
this->addChild(menu);
menu->setPosition(ccp(33, 119));
// CCLabelBMFont* lblName = CCLabelBMFont::create("阵营", "test.fnt");
CCLabelTTF *lblShout = CCLabelTTF::create("喊话", FONT_VERDANA, FONT_SIZE_MEDIUM);
lblShout->setColor(ccc3(197, 255, 255));
lblShout->enableStroke(ccc3(69, 20, 21), 1);
CCMenuItemLabel* menuShout = CCMenuItemLabel::create(lblShout, this, menu_selector(ChatLayer::menuCallback));
menuShout->setPosition(ccp(4,80));
menuShout->setTag(101);
menu->addChild(menuShout);
CCLabelTTF *lblWorld = CCLabelTTF::create("世界", FONT_VERDANA, FONT_SIZE_MEDIUM);
lblWorld->setColor(ccc3(197, 255, 255));
lblWorld->enableStroke(ccc3(69, 20, 21), 1);
CCMenuItemLabel* menuWorld = CCMenuItemLabel::create(lblWorld, this, menu_selector(ChatLayer::menuCallback));
menuWorld->setPosition(ccp(4,50));
menuWorld->setTag(102);
menu->addChild(menuWorld);
CCLabelTTF *lblFaction = CCLabelTTF::create("阵营", FONT_VERDANA, FONT_SIZE_MEDIUM);
lblFaction->setColor(ccc3(197, 255, 255));
lblFaction->enableStroke(ccc3(69, 20, 21), 1);
CCMenuItemLabel* menuFaction = CCMenuItemLabel::create(lblFaction, this, menu_selector(ChatLayer::menuCallback));
menuFaction->setPosition(ccp(4,20));
menuFaction->setTag(103);
menu->addChild(menuFaction);
CCLabelTTF *lblGroup = CCLabelTTF::create("公会", FONT_VERDANA, FONT_SIZE_MEDIUM);
lblGroup->setColor(ccc3(197, 255, 255));
lblGroup->enableStroke(ccc3(69, 20, 21), 1);
CCMenuItemLabel* menuGroup = CCMenuItemLabel::create(lblGroup, this, menu_selector(ChatLayer::menuCallback));
menuGroup->setPosition(ccp(4,-10));
menuGroup->setTag(104);
menu->addChild(menuGroup);
CCLabelTTF *lblPrivate = CCLabelTTF::create("蜜语", FONT_VERDANA, FONT_SIZE_MEDIUM);
lblPrivate->setColor(ccc3(197, 255, 255));
lblPrivate->enableStroke(ccc3(69, 20, 21), 1);
CCMenuItemLabel* menuPrivate = CCMenuItemLabel::create(lblPrivate, this, menu_selector(ChatLayer::menuCallback));
menuPrivate->setPosition(ccp(4,-40));
menuPrivate->setTag(105);
menu->addChild(menuPrivate);
}
示例2: AnimateRockLabel
void Player::AnimateRockLabel()
{
CCLabelTTF *rockLabel = CCLabelTTF::create("+1 Rock", GAME_FONT.c_str(), 20);
rockLabel->setPosition(ccp(playerSprite->getPosition().x , playerSprite->getPosition().y + playerSprite->getContentSize().height/2));
this->addChild(rockLabel , 10);
rockLabel->runAction(CCSequence::create(CCMoveBy::create(0.25f, ccp(0 , 80)),
CCDelayTime::create(0.5f),
CCMoveBy::create(0.5f, ccp( -100 , 0 )),
CCCallFuncN::create(this, callfuncN_selector(Player::RemoveRockLabel)),
NULL));
rockLabel->setColor(ccORANGE);
rockLabel->enableStroke(ccBLACK, 1);
}
示例3: init
// Initialize the UI for the main game scene
//
// return - false if there was an error in initializing, true otherwise
bool UILayer::init()
{
CCLabelTTF* labelPause; // the text for pause menu item
CCMenuItemLabel* itemPause; // menu item for opening the pause menu
CCMenu* menu; // menu to contain the menu item
CCSize size; // the size of the window
if(!CCLayer::init())
{
return false;
}
// get the window size from the director
size = CCDirector::sharedDirector()->getWinSize();
// create the pause menu item, and add an outline around it to make it readable
labelPause = CCLabelTTF::create("Pause", FONT_STYLE, Font_Size_Default);
labelPause->enableStroke(FONT_STROKE_COLOR, FONT_STROKE_THICK);
// Set up for single player or not
if(Is_Single_Player)
{
SetUpSinglePlayer(size);
}
else
{
SetUpMultiPlayer(size);
}
itemPause = CCMenuItemLabel::create(labelPause, this, menu_selector(UILayer::HandlePausePressed));
itemPause->setColor(MENU_COLOR);
itemPause->setPosition(ccp(size.width * PAUSE_WIDTH_POS, size.height * PAUSE_HEIGHT_POS));
// create the menu containing the pause item
menu = CCMenu::create(itemPause, NULL);
menu->setPosition(CCPointZero);
this->addChild(m_scoreLabel, 1);
this->addChild(menu, 1);
return true;
}