本文整理汇总了C++中CCMenuItemFont::getTag方法的典型用法代码示例。如果您正苦于以下问题:C++ CCMenuItemFont::getTag方法的具体用法?C++ CCMenuItemFont::getTag怎么用?C++ CCMenuItemFont::getTag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCMenuItemFont
的用法示例。
在下文中一共展示了CCMenuItemFont::getTag方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: alignmentChanged
void BitmapFontMultiLineAlignment::alignmentChanged(cocos2d::CCObject *sender)
{
CCMenuItemFont *item = (CCMenuItemFont*)sender;
item->setColor(ccRED);
this->m_pLastAlignmentItem->setColor(ccWHITE);
this->m_pLastAlignmentItem = item;
switch(item->getTag())
{
case LeftAlign:
this->m_pLabelShouldRetain->setAlignment(kCCTextAlignmentLeft);
break;
case CenterAlign:
this->m_pLabelShouldRetain->setAlignment(kCCTextAlignmentCenter);
break;
case RightAlign:
this->m_pLabelShouldRetain->setAlignment(kCCTextAlignmentRight);
break;
default:
break;
}
this->snapArrowsToEdge();
}
示例2: stringChanged
void BitmapFontMultiLineAlignment::stringChanged(cocos2d::CCObject *sender)
{
CCMenuItemFont *item = (CCMenuItemFont*)sender;
item->setColor(ccRED);
this->m_pLastAlignmentItem->setColor(ccWHITE);
this->m_pLastAlignmentItem = item;
switch(item->getTag())
{
case LongSentences:
this->m_pLabelShouldRetain->setString(LongSentencesExample);
break;
case LineBreaks:
this->m_pLabelShouldRetain->setString(LineBreaksExample);
break;
case Mixed:
this->m_pLabelShouldRetain->setString(MixedExample);
break;
default:
break;
}
this->snapArrowsToEdge();
}
示例3: onClick
void MenuScene::onClick(CCObject* sender)
{
CCMenuItemFont* pFont = (CCMenuItemFont*) sender;
switch( pFont->getTag() )
{
case 1:
{
CCSceneManager::sharedManager()->pushScene(
CCSceneExTransitionFade::create(1.0f, LoadScene("BasicSceneTest"))
);
}
break;
}
}
示例4: menuCallback
void ChatLayer::menuCallback(CCObject* sender)
{
// MainGameScene *mainScene = (MainGameScene *)this->getParent();
CCMenuItemFont *button = (CCMenuItemFont *)sender;
switch (button->getTag()) {
case 101:
{
break;
}
case 102:
{
break;
}
}
}
示例5: selectOption
/* Select option callback */
void LuaDecisionTree::selectOption(CCObject* pSender) {
CCMenuItemFont *item = (CCMenuItemFont*)pSender;
m_response = item->getTag();
//Remove all children
/* for(CCNode *n in optionsNode->children()){
optionsNode->removeChild(n , true);
}*/
this->removeChild(optionsNode , true);
//Re-add optionsNode
optionsNode = CCNode::create();
optionsNode->setPosition(ccp(0,0));
optionsNode->setVisible(false);
this->addChild(optionsNode , 6);
optionsOnScreen = 0;
//Resume the script
m_sc->YieldResume();
}
示例6: menuCloseCallback
void Campaign::menuCloseCallback(CCObject *pSender)
{
CCMenuItemFont *font = (CCMenuItemFont*)pSender;
int tag = font->getTag();
stageNum = tag;
CCLOG("%d",tag);
switch (tag) {
case campTag_start:
{
SelectStage *stage = (SelectStage *)getChildByTag(campTag_SelectStage);
CCDirector::sharedDirector()->replaceScene(GameLayer::scene((stageTag)stage->tag));
break;
}
case campTag_soldiers:
break;
case campTag_mainMenu:
CCDirector::sharedDirector()->replaceScene(SelectMode::scene());
break;
default:
break;
}
}