精灵点击移动

CCSetIterator it = pTouches->begin();

    CCTouch *touch = (CCTouch*)(*it);

    CCPoint m_tBeginPos = touch->getLocationInView();

    m_tBeginPos = CCDirector::sharedDirector()->convertToGL(m_tBeginPos);

    CCAction *moveto = CCMoveTo::create(2, m_tBeginPos);

    player->runAction(moveto);

 

posted on 2013-04-16 21:54  jack_yan  阅读(168)  评论(0)    收藏  举报