ActionInterval *scale1 = ScaleTo::create(.05f, 1.3f);
ActionInterval *scale2 = ScaleTo::create(.1f, 0.0f);
runAction(CCSequence::create(
scale1,
scale2,
CCDelayTime::create(.8f),
CCCallFuncN::create(this,callfuncN_selector(DressMe_LevelManager::removeTheObjectFromArray)),
NULL));
void DressMe_LevelManager:: removeTheObjectFromArray(DressMe_objectClass *l_obj){
m_ptrArrayElements->removeObject(l_obj);
l_obj = NULL;
MoveBakTheCart();
}
我收到此错误:
static_cast from void (DressMe_LevelManager::*) (Dress_ObjectClass *) to cocos2d::SEL_CallfuncN (aka void (cocos2d:Ref::*) (cocos2d::Node *) ) is not allowed
答案 0 :(得分:0)
更改操作如下:
runAction(CCSequence::create(
scale1,
scale2,
CCDelayTime::create(.8f),
CallFuncN::create(CC_CALLBACK_1(HelloWorld::removeTheObjectFromArray, this)),
NULL));
不推荐使用callfuncN_selector
,它接受具有Node*
类型参数的函数。因此当removeTheObjectFromArray
接受Dress_ObjectClass
的对象时,它会出错。