本文整理汇总了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();
}
示例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();
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
}
示例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;
}