摘要: Cocos2d作为一个开源的2D游戏引擎,最初是用python语言实现,mac app开发流行后,提供了一个Objective-C的版本。采用Cocos2d框架开发iphone游戏,极大提高了开发的速度。简单介绍参见百度百科,cocos2d官网。Cocos2d提供了两种touch处理方式,Standard Touch Delegate和Targeted Touch Delegate方式(参见CCTouchDelegateProtocol.h中源代码),CCLayer默认是采用第一种方式(参见CCLayer的 registerWithTouchDispatcher方法)。 在CCLayer子类中 阅读全文
posted @ 2011-04-09 21:54 Penny●zheng 阅读(1783) 评论(0) 推荐(0)
摘要: 一,iPhone OS 提供了关亍触摸(Touch)的以下 4 个事件响应凼数: (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {} (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {} (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {} (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *. 阅读全文
posted @ 2011-04-09 21:25 Penny●zheng 阅读(2338) 评论(1) 推荐(0)