cannot handle touches, chipmunk debugNode not shown anymore

cannot handle touches, chipmunk debugNode not shown anymore
0.0 0


Hi all,
i created a game with different layers using cocosbuilder. So far it worked under cocos2d-iphone well. But under cocos2d-x v3.0 i cannot handle touch events. It seems there are noch handlers like onTouchesBegan.
If i follow this post and try to add a Listener then i get a

TypeError: cc.eventManager is undefined

I already printed out the javascript methods, my CCLayer object has. There are no delegate methods like onTouchesBegan anymore. How can i handle touch events now?

Another problem is that the cc.PhysicsDebugNode doesn’t shows up. I create and add it like that:

this._debugNode = cc.PhysicsDebugNode.create(this._space);
this._gameNode.addChild(this._debugNode, 1000000);//CONSTANTS.ZINDEX.DEBUGNODE);

And i see, how the physics body interact on screen but i cannot see the shapes that normally are drawn by the physics node. I checked the cocos2d-x HTML5 API. There isn’t even a doc about cc.PhysicsDebugNode.
Is it removed from the api? I would wonder about because i don’t get an error under ios simulator.
Thank you.


Hi, @roelfsche

Are you using this repo for your project: ? Things have been changed in 3.0, before, you can use only Cocos2d-x to develop your JSB project which is no longer possible in the last release. All JSB support have been moved to Cocos2d-JS repo which support both Cocos2d-html5 and Cocos2d-JSBinding. And in this repo, normally there is no problem for using cc.eventManager.
For more information, please refer to

As for Cocos2d-JS 3.0 alpha version, we do have problem with cc.PhysicsSprite, not sure if it’s the same that you met. We will fix it in the next release.
Sorry for the lack of documentation, we will try to improve that as soon as possible.



Hi @pandamicro,
thank you for your reply.
I cloned the repo, inited all the submodules.
Seems that the console installation process isn’t ready yet. Needed to copy the bin path manually. Didn’t work so far because i get python erros if i call cocos. But running the cocos sh script from the repo dir works for me. So i was able to do a

./cocos new -d /tmp/MyGame -l js

There are now several directories with xcode proj files. i think for js binding i need to open


Is that right?
The js sample that comes with showed up.
But then i just copied the example provided on

var listener1 = cc.EventListener.create({

It is replied with a

TypeError: cc.EventListener.create is not a function

by the system. Did i compile the wrong project, because there are some other .xcodeproj.
Thank you.


Hi @pandamicro,
i searched the project and found the definition of the cc.EventManager methods in the jsb_cocos2d.js file.
After requiring it in main.js it works.
May be the template is buggy or i still work on the wrong project ;-).



It’s really odd, we do have require all necessary js file like “jsb_cocos2d.js” in function. I don’t understand why it haven’t been in your project. You shouldn’t need to require it in main.js, can you check in jsb_boot.js whether this line of code exist require("jsb.js"); ?


The run method calls the prepare method which requires jsb.js. And it is called (my cc.log was printed out).
And it requires jsb_cocos2d.js (probably before my own requirement).
I rechecked it: without my own require the cc.EventListener.create method isn’t defined. If i require explicitely it works.