Hi,
I use cocos2d-x 2.2 and I’m trying to detect touch events.
At first, I was developing in linux in order to test the application without using my mobil. But I noticed that ccTouchesBegan weren’t called. So looking on the Internet I read that mouse clicks are not mapped as touch events. Is that true?
Ok. Then I tried to test my game in my android device. But the event is not called either. So I put an std::cout to send a message, so that I can know if the function is called (maybe the error comes from my code). But the method is not called.
Now I don’t know if Android doesn’t give support to std::cout and thats why I cannot see any message in logcat. Or maybe the problem is that the method is not being called. Do I have to enable something?
I wrote the method as a class method:
HelloWorld::ccTouchesBean() { …cout&something… } in my HelloWorldScene.cpp. Is It this implementation correct?
I know this is an old conversation, but my company is still using cocos2d-x v2.
Please correct my understanding if I’m wrong, but must we always add a targeted delegate to enable touch?
Must we not remove that delegate later to prevent a leak?