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


C++ CCCallFuncO类代码示例

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


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

示例1: CCARRAY_FOREACH

void NDKHelper::ExecuteCallfuncs( float dt )
{
	CCObject *obj;
	CCARRAY_FOREACH(callfuncs, obj) {
		CCCallFuncO *callfunc = (CCCallFuncO*) obj;
		callfunc->execute();
	}
开发者ID:AllenCoder,项目名称:EasyNDK-for-cocos2dx,代码行数:7,代码来源:NDKHelper.cpp

示例2: va_start

void Trooper::animate(const char* animationName, ...){
	va_list params;
	va_start(params, animationName);
	const char* nextName = animationName;
	if (m_current_sprite != NULL && m_animate_action != NULL){
		m_current_sprite->stopAction(m_animate_action);
		m_animate_action = NULL;
	}
	CCArray* animations = CCArray::array();

	while (nextName){
		CCAnimation* anim = TFAnimationCache::sharedAnimationCache()->animationByName(nextName);
		if (m_current_sprite == NULL){
			m_current_sprite = CCSprite::spriteWithSpriteFrame(anim->getFrames()->getObjectAtIndex(0));
			this->addChild(m_current_sprite);
		}
		CCCallFuncO* notifyAction = CCCallFuncO::actionWithTarget(this, callfuncO_selector(Trooper::onAnimationStart), new CCString(nextName));
		animations->addObject(notifyAction);
		nextName = va_arg(params, const char*);
		if (nextName == NULL){
			CCCallFuncO* animAction = CCCallFuncO::actionWithTarget(this, callfuncO_selector(Trooper::animateForever), anim);
			animations->addObject(animAction);
			animAction->retain();
		} else {
			animations->addObject(CCAnimate::actionWithAnimation(anim));
		}
		notifyAction->retain();
	}
	m_current_sprite->runAction(CCSequence::actionsWithArray(animations));
	va_end(params);
	animations->retain();
}
开发者ID:jjay,项目名称:trooperfall,代码行数:32,代码来源:Trooper.cpp

示例3: CCCallFuncO

 CCCallFuncO * CCCallFuncO::actionWithTarget(SelectorProtocol* pSelectorTarget, SEL_CallFuncO selector, CCObject* pObject)
 {
     CCCallFuncO *pRet = new CCCallFuncO();
     if(pRet->initWithTarget(pSelectorTarget, selector, pObject))
     {
         pRet->autorelease();
         return pRet;
     }
     CC_SAFE_DELETE(pRet);
     return NULL;
 }
开发者ID:daoopp,项目名称:WebGame,代码行数:11,代码来源:CCActionInstant.cpp

示例4: CCCallFuncO

CCCallFuncO* CCCallFuncO::actionWithScriptFuncName(const char *pszFuncName) {
	CCCallFuncO *pRet = new CCCallFuncO();

	if (pRet && pRet->initWithScriptFuncName(pszFuncName)) {
		pRet->autorelease();
		return pRet;
	}

	CC_SAFE_DELETE(pRet);
	return NULL;
}
开发者ID:Openxlive,项目名称:cocos2d-x-win8-tests-metro-style,代码行数:11,代码来源:CCActionInstant.cpp

示例5: CCCallFuncO

CCCallFuncO* CCCallFuncO::create(ccScriptFunction func, CCObject* pObject) {
    CCCallFuncO *pRet = new CCCallFuncO();
    if (pRet && pRet->initWithScriptTarget(func, pObject)) {
        CC_SAFE_AUTORELEASE(pRet);
        return pRet;
    }
    
    CC_SAFE_DELETE(pRet);
    return NULL;
    return pRet;
}
开发者ID:suncle,项目名称:cocos2dx-classical,代码行数:11,代码来源:CCActionInstant.cpp

示例6: onLinkMenuItemClicked

void CCRichLabelTTF::onLinkMenuItemClicked(CCObject* sender) {
	CCMenuItemColor* item = (CCMenuItemColor*)sender;
	CCCallFunc* func = (CCCallFunc*)item->getUserData();
    if(func){
        CCCallFuncO *funcO = dynamic_cast<CCCallFuncO*>(func);
        if(funcO){
            funcO->setObject(CCInteger::create(item->getTag() - START_TAG_LINK_ITEM));
        }
		func->execute();
    }
}
开发者ID:ourgames,项目名称:dc208,代码行数:11,代码来源:CCRichLabelTTF.cpp

示例7: CCCallFuncO

CCCallFuncO* CCCallFuncO::create ( CCObject* pSelectorTarget, SEL_CallFuncO pSelector, CCObject* pObject )
{
    CCCallFuncO*  pRet = new CCCallFuncO ( );

    if ( pRet && pRet->initWithTarget ( pSelectorTarget, pSelector, pObject ) )
    {
        pRet->autorelease ( );
    }
	else
	{
		CC_SAFE_DELETE ( pRet );
	}
    
	return pRet;
}
开发者ID:mcodegeeks,项目名称:OpenKODE-Framework,代码行数:15,代码来源:CCActionInstant.cpp


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