・旧
CCTouchDispatcher::sharedDispatcher()->addTargetedDelegate(this, 0, true);
・新(v2.x) こうした
CCTouchDispatcher* touchDispatcher = CCDirector::sharedDirector()->getTouchDispatcher(); touchDispatcher->addTargetedDelegate(this, 0, true);
・旧
this->setIsTouchEnabled(true);
・新 "Is"が消えた!
this->setTouchEnabled(true);
・旧(これも動かない)
CCPoint touchLocation = touch->locationInView(touch->view()); touchLocation = CCDirector::sharedDirector()->convertToGL(touchLocation);
touch->view()、つまり、CCTouchのview()メソッドがなくなってる??
↓こうすると思ったが、これは非推奨だった
CCPoint touchLocation = touch->locationInView();
↓まず、ここを参考
URL:http://www.cocos2d-x.org/reference/native-cpp/de/d9b/classcocos2d_1_1_c_c_touch.html
CCPoint getDelta () const returns the current touch location in screen coordinates CCPoint getLocationInView () const returns the current touch location in screen coordinates
・新(v2.x) これが正しい
CCPoint touchLocation = touch->getLocationInView();