当前位置: 首页>>代码示例>>C++>>正文


C++ CCMenuItemFont::getTag方法代码示例

本文整理汇总了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();
}
开发者ID:GhostSoar,项目名称:Cocos2dWindows,代码行数:25,代码来源:LabelTest.cpp

示例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();
}
开发者ID:GhostSoar,项目名称:Cocos2dWindows,代码行数:25,代码来源:LabelTest.cpp

示例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;
	}
}
开发者ID:253627764,项目名称:CocosBase,代码行数:14,代码来源:MenuScene.cpp

示例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;
		}
	}
}
开发者ID:crazyit,项目名称:iGame,代码行数:16,代码来源:ChatLayer.cpp

示例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();
}
开发者ID:pdpdds,项目名称:cocos2dx-dev,代码行数:22,代码来源:LuaDecisionTree.cpp

示例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;
    }
}
开发者ID:the9zhanhuoyingxiong,项目名称:strickforce,代码行数:24,代码来源:Campaign.cpp


注:本文中的CCMenuItemFont::getTag方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。