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


C++ CCNode::getUserData方法代码示例

本文整理汇总了C++中CCNode::getUserData方法的典型用法代码示例。如果您正苦于以下问题:C++ CCNode::getUserData方法的具体用法?C++ CCNode::getUserData怎么用?C++ CCNode::getUserData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CCNode的用法示例。


在下文中一共展示了CCNode::getUserData方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

CCRichLabelTTF::~CCRichLabelTTF()
{
    CC_SAFE_DELETE(m_pFontName);
	
	// release callfunc
	CCMenu* menu = (CCMenu*)getChildByTag(TAG_MENU);
	if(menu) {
		CCObject* obj;
        const auto& children = menu->getChildren();
        for (const auto& child : children)
        {
            CCNode* item = (CCNode*)child;
            CCObject* data = (CCObject*)item->getUserData();
            CC_SAFE_RELEASE(data);
        }
//		CCARRAY_FOREACH(menu->getChildren(), obj) {
//			CCNode* item = (CCNode*)obj;
//			CCObject* data = (CCObject*)item->getUserData();
//			CC_SAFE_RELEASE(data);
//		}
	}
	
	// release other
	m_stateListener->release();
}
开发者ID:ourgames,项目名称:dc208,代码行数:25,代码来源:CCRichLabelTTF.cpp

示例2: btnJoinCallback

void GameRankLayer::btnJoinCallback(CCObject* pSender)
{
	SoundPlayer::play(SNDI_CLICK);
	CCNode* sender = dynamic_cast<CCNode*>(pSender);
	if(sender)
	{
		PokerPlayerRankInfo* ptrInfo = static_cast<PokerPlayerRankInfo*>(sender->getUserData());
		if(ptrInfo)
		{
			TableLayer* tableLayer = (TableLayer*)getParent();
			tableLayer->sendGotoTableCmd(ptrInfo->account_id);
		}
	}
}
开发者ID:forappengine,项目名称:texasholdem,代码行数:14,代码来源:GameRankLayer.cpp

示例3: failCallBackFun

//失败回调
void GameStage::failCallBackFun(CCObject* data)
{
	this->updateCombo();
	this->updateScore();
	this->updateHighScore();
	this->layoutScoreNum(this->highScoreList, 2);
	//this->newHighScore->stopAllActions();
	CCNode* nNode = (CCNode*) data;
	CCString* str = (CCString*)nNode->getUserData();
	CCString* newRecordStr = new CCString(NEW_RECORD);
	//判断2个字符串相等
	if(str->isEqual(newRecordStr))
	{
		Cookie::getShareUserData()->setIntegerForKey("highScore", this->pukaManCore->highScore);
		Cookie::getShareUserData()->flush();
		this->newHighScore->stopAllActions();
		this->newHighScore->setScale(0.0f);
		CCActionInterval* scaleTo1 = CCScaleTo::create(0.5f, 1.0f);
		CCDelayTime* delayTime = CCDelayTime::create(1.0f);
		CCActionInterval* scaleTo2 = CCScaleTo::create(0.5f, 0.0f);
		CCSequence* sequence = CCSequence::create(scaleTo1, delayTime, scaleTo2, NULL);
		this->newHighScore->runAction(sequence);
	}
}
开发者ID:kanon1109,项目名称:Pukaman,代码行数:25,代码来源:GameStage.cpp


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