cocos2d-android:触摸事件未触发
在我的自定义 CCLayer 中,我使用 4 个函数来覆盖触摸事件:
@Override
public boolean ccTouchesBegan(MotionEvent event) {
return CCTouchDispatcher.kEventHandled;
}
@Override
public boolean ccTouchesEnded(MotionEvent event) {
return super.ccTouchesEnded(event);
}
@Override
public boolean ccTouchesMoved(MotionEvent event) {
return super.ccTocuhesMoved(event);
}
@Override
public boolean ccTouchesCancelled(MotionEvent event) {
return super.ccTouchesCancelled(event);
}
以上都没有响应。触摸事件没有触发有什么原因吗?
In my custom CCLayer, I use 4 functions to override touch events:
@Override
public boolean ccTouchesBegan(MotionEvent event) {
return CCTouchDispatcher.kEventHandled;
}
@Override
public boolean ccTouchesEnded(MotionEvent event) {
return super.ccTouchesEnded(event);
}
@Override
public boolean ccTouchesMoved(MotionEvent event) {
return super.ccTocuhesMoved(event);
}
@Override
public boolean ccTouchesCancelled(MotionEvent event) {
return super.ccTouchesCancelled(event);
}
None of the above is responding. Any reason that the touch events not firing ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果有人遇到同样的问题,请记住在构造函数中添加以下行:
If anyone encounters the same problem, please remember to add the following line to constructor: