cocos2d-x 得到点击时坐标的值

在void HelloWorld::ccTouchBegan( CCTouch *pTouch, CCEvent *pEvent )中

      CCPoint touchPoint = CCDirector::sharedDirector()->convertToGL(pTouch->getLocationInView());  

在void HelloWorld::ccTouchesBegan( CCSet *pTouches, CCEvent *pEvent )中

    CCSetIterator it = pTouches->begin();
    CCTouch *touch = (CCTouch*)(*it);

    CCPoint touchPoint = CCDirector::sharedDirector()->convertToGL(touch ->getLocationInView());  

在move和ccTouchEnded也一样

你可能感兴趣的:(cocos2dx)