the menus and buttons on the SwallowLayer can not touch.


engine version: JSB, 3.0alpha1 ,XCODE,模拟器环境
issue: 还是说中文吧… 我的问题是在JSB版本中,如果我要做一个模态类型的层,那我会在当前层注册 cc.registerTargetedDelegate(-2, true, this);,然后在onTouchBegan里returne true。 如果层与层之间的模态,这个毫无问题。但是一旦我在最上层的层上加上了ccmenu,那问题就出来了。
4.我不Swallow上层 touch,但下层Swallow了,并且在上层设置了点击区域。表面上是OK了,但其实它是会穿透上下层的。如果有ccmenu是恰好是同一位置,那我觉的这个依然是个问题。。

我总结下我的问题:当前层只要Swallow touch事件,在该层上的ccmenu和button就都不会响应,把他们的priority设置最高也是一样的。



Hi, @jo_2011

Since Cocos2d-x 3.0, we have refactored the event dispatching system. cc.registerTargetedDelegate and all layer’s event functions have been deprecated. So you should migrate your implementation with the new event dispatching system.

If you want to upgrade your usb project with the newest Cocos2d engine, you should download Cocos2d-JS which include Cocos2d-x 3.0 rc0 and Cocos2d-html5 3.0 alpha: Download link

In the download package, you can find the test cases shared by html5 and jsb. The test case jsb project can be found in the folder build, and you will find tests which shows you how to use the new event system at Event Manager Test. And the sub test PauseResumeTargetTest shows exactly what you want to do.

Tell us if the new event system solve your problem.
Oh, note that the Cocos2d-JS 3.0 API have been refactored to improve javascript development experience, for more details please refer to this topic, and the upgrade guide is here:


OK. I’ll try …


2.2.3 jsb xcode还是有问题。




We recommend Cocos2d-JS 3.0 to do JSB project.
For now we didn’t have extra time and man to fix 2.x JSB problems. We have been focus on fix all these issues for Cocos2d-JS 3.0
With all new features in Cocos2d-x 3.0, fixed API incompatible issues between html5 and JSB, adopted JS style API in html5 engine, hope you can enjoy much more JSB in Cocos2d-JS !