void HelloWorld::startMovingBackground() {
CCLog("startMovingBackground...");
if ( isLeftPressed && isRightPressed ) {
return;
}
CCLog("schedule..."); // OK.......................
this->schedule(schedule_selector(HelloWorld::moveBackground));
}
和
void HelloWorld::moveBackground(float f) {
CCLog("moveBackground %f", f); // NO....................
// Do move background...
}
但是,没有调用 moveBackground 函数。帮我...
==================================================== ========
代码(初始化“HelloScene”)
CCScene* HelloWorld::scene() {
CCScene * scene = NULL;
do {
scene = CCScene::create();
CC_BREAK_IF(! scene);
HelloWorld *layer = HelloWorld::create();
CC_BREAK_IF(! layer);
scene->addChild(layer);
} while (0);
return scene;
}
bool HelloWorld::init()
{
bool bRet = false;
do {
CC_BREAK_IF(! CCLayerColor::initWithColor(ccc4(255, 255, 255, 255)) );
this->setTouchEnabled(true);
winSize = CCDirector::sharedDirector()->getWinSize();
this->setTouchEnabled(true);
this->createBackgroundParallax();
this->createArrowButtons();
bRet = true;
} while (0);
return bRet;
}