bool HelloWorld::init()
{
if ( !Layer::init() )
{
return false;
}
Size visibleSize = Director::getInstance()->getVisibleSize();
label=LabelTTF::create("daochong","Courier",30);
addChild(label);
//scheduleUpdate();
schedule(schedule_selector(HelloWorld::timerHandler),1);
return true;
}
void HelloWorld::timerHandler(float dt){
log(">>>>>>>");
}
void HelloWorld::update(float dt){
label->setPosition(label->getPosition()+Point(1,1));
if (label->getPositionX()>500) {
unscheduleUpdate();
}
}
原文:http://www.cnblogs.com/daochong/p/5232586.html