大佬教程收集整理的这篇文章主要介绍了cocos2d-x-2.2.5 触摸机制,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
<span style="white-space:pre"> </span>
<span style="white-space:pre"> </span>virtual void registerWithTouchDispatcher(void); virtual void ccTouchesBegan(CCSet *pTouches,CCEvent *pEvent); // 触摸事件中开始时调用的回调函数 virtual void ccTouchesMoved(CCSet *pTouches,CCEvent *pEvent); virtual void ccTouchesEnded(CCSet *pTouches,CCEvent *pEvent); virtual void ccTouchesCancelled(CCSet *pTouches,CCEvent *pEvent);
bool sjt::init() {
<span style="white-space:pre"> // 1. super init first <span style="white-space:pre"> </span>if(!CCLayer::init()) <span style="white-space:pre"> </span>{ <span style="white-space:pre"> </span>return false; <span style="white-space:pre"> </span>}</span>
</pre><pre name="code" class="cpp"><span style="white-space:pre"> // for touch control <span style="white-space:pre"> </span>setTouchEnabled(true); <span style="white-space:pre"> </span>isTouchDown = false;</span>
}
void sjt::registerWithTouchDispatcher() { CCDirector::sharedDirector()->getTouchDispatcher()->addStandardDelegate(this,0); }
以上是大佬教程为你收集整理的cocos2d-x-2.2.5 触摸机制全部内容,希望文章能够帮你解决cocos2d-x-2.2.5 触摸机制所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。