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存在,而不再是单例了.
posted @ 2012-08-28 15:56  坤坤同学  阅读(90)  评论(0编辑  收藏  举报