Touch Handling in Cocos2D 3.x(一)

简介:

原帖地址

Cocos2d 3.0 带来经过完全修正后的触摸处理系统.本篇博文将提供所有触摸相关的信息:

  • 接收触摸
  • 取得触摸位置
  • 处理不同个触摸生命周期中的事件
  • 实现一个拖放机制

让我们开始吧 ;)

通过下载开始项目开始我们的旅程: starter project

一旦你下载运行项目,你可以运行App看到如下屏幕:

这里写图片描述

Cocos2D 3.3+ 需要注意的地方

如果你使用Cocos2D 3.3+ (它是SpriteBuilder 1.3+的一部分) 你必须分别使用CCTouch和CCTouchEvent替换所有的UITouch和UITouchEvent类.你可以在SpriteBuilder的升级手册中找到更多的信息.

相关文章
|
10月前
|
Dart 安全
Flutter开发Cannot run with sound null safety报错
Flutter开发Cannot run with sound null safety报错
|
JavaScript
support mobile touch event
If extra event support is needed, jQuery mobile event plugin is loaded to support tap, swipe and scrollstart/stop events. The old touch to mouse event simulation will be deregistered and the new one will be activated.
94 0
support mobile touch event