万年素人からHackerへの道

万年素人がHackerになれるまで殴り書きするぜ。

  • ・資産運用おすすめ
    10万円は1000円くらい利益
    資産運用ブログ アセマネ
    • ・寄付お願いします
      YENTEN:YYzNPzdsZWqr5THWAdMrKDj7GT8ietDc2W
      BitZenny:ZfpUbVya8MWQkjjGJMjA7P9pPkqaLnwPWH
      c0ban:8KG95GXdEquNpPW8xJAJf7nn5kbimQ5wj1
      Skycoin:KMqcn7x8REwwzMHPi9fV9fbNwdofYAWKRo

    cocos2d-xのv2.xで動かなくなった

    ・旧

      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();