Menus
If you create menus likes this:
CCMenuItem * QuitButton= CCMenuItemImage::create("quit.png"
,"quitpressed.png"
,this,
menu_selector(DownHill::Quit) );
void Quit();
to
void Quit(Object* sender);
If you used scheduled calls like this:
this->scheduleOnce( schedule_selector(GameBase::RestartRound),2.5f);
void RestartRound(float f);
I used to create a particle system like this, but now this is protected
CCParticleSystem* particle = new CCParticleSystemQuad ();
particle-> initWithTotalParticles (100);
ParticleSystem* particle = ParticleSystemQuad::create ();
particle->setTotalParticles(200);
Big changes to the way touch events work (for the better!) but to just get things going in the old way, change ccTouchBegan to onTouchBegan (same for Moved and Ended) and then register to get the events like this:
// Register Touch Event
auto dispatcher = Director::getInstance()->getEventDispatcher();
auto listener = EventListenerTouchOneByOne::create();
listener->onTouchBegan = CC_CALLBACK_2(DownHill::onTouchBegan, this);
listener->onTouchMoved = CC_CALLBACK_2(DownHill::onTouchMoved, this);
listener->onTouchEnded = CC_CALLBACK_2(DownHill::onTouchEnded, this);
dispatcher->addEventListenerWithSceneGraphPriority(listener, this);
this->setTouchEnabled(true);
Also, this post is really helpful:
http://www.redtgames.com/blog/cocos2d-x-v2-to-v3-mapping-guide/
No comments:
Post a Comment