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

来源:互联网 发布:java web项目百度云 编辑:程序博客网 时间:2024/05/09 03:45

在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也一样

原创粉丝点击