我試圖在我的遊戲中獲得介紹屏幕。幾秒鐘後,它應該改變爲遊戲本身。Sel_CallFuncN無法將空格投射到Sel_CallFuncN
在我introscreen類的初始化,我儘量讓一個序列,但我發現了以下錯誤:
cannot cast from type void to member pointer type 'cocos2d::SEL_CallFuncN' (aka 'void(cocos2d::CCObject::*)(cocos2d::CCNode *)'
這裏是我的代碼:
bool IntroScreen::init() {
if (!CCLayer::init()) {
return false;
}
cocos2d::CCSize screenSize = cocos2d::CCDirector::sharedDirector()->getWinSize();
cocos2d::CCSprite* logomarca = cocos2d::CCSprite::create("rayman_intro.png");
logomarca->setPosition(ccp(screenSize.width/2, screenSize.height/2));
this->addChild(logomarca, 1);
cocos2d::CCFiniteTimeAction *seq1 = cocos2d::CCSequence::create(cocos2d::CCDelayTime::create(3.0),
cocos2d::CCCallFuncN::create(this,
cocos2d::SEL_CallFuncN(cocos2d::CCDirector::sharedDirector()->replaceScene(Controller::scene())), NULL);
this->runAction(seq1);
return true;
}
我在做什麼錯誤?
謝謝我設法使用這 – Aelion
酷.... :) ...... – Jain