cocos2d触摸分发

cocos2d触摸分发的原理参考下面的一篇文章. http://article.ityran.com/archives/1326 但是在cocos2d 2.0的版本中用法有点不一样.之前的addTargetedDelegate用法是: [[CCTouchDispatcher sharedDispatcher] addTargetedDelegate:self priority:-1 swallowsTouches:YES]; 现在是: [[[CCDirector sharedDirector] touchDispatcher] addTargetedDelegate:self priority:-1 swallowsTouches:YES]; CCTouchDispatcher作为CCDirector中的一个@property存在,而不再是单例了.
原文地址:https://www.cnblogs.com/wanyakun/p/3403315.html