Problem with ccTouchEnded

Problem with ccTouchEnded
0.0 0


In my project are two scenes. First is default HelloWorld with some changes, second scene is the same. In fist scene button(like default close button) replace scene to second. And in my second scene i want racieve touches, i added
void ccTouchEnded(CCTouch pTouch, CCEventpEvent);
in .h and
void TestLevel::ccTouchEnded(CCTouch pTouch, CCEventpEvent)
if (!isStarted)
isStarted = true;
in .cpp and call
in init()
but breakpoint in method ccTouchEnded don’t hit.
I doing all like in tutorial with ninja, using cocos2d-2.0-x-2.0.3 (last version).
Please help me, what i’m doing wrong?
p.s. sorry for my bad english:)




sorry, but i can understand only english, ukrainian or russian :frowning:


Hi Oleg,

try using ccTouchesEnded instead of ccTouchEnded.
you can check Box2D HelloWorld example, that will help you understand touch delegate.

also check out this link to understand touch delegate in detail, this one is for Cocos2D so syntax is different but concept is same:[]=targeted&s[]=standard



Thanks Paresh!
I read your link and it helped me understand how it works.
I changed ccTouchEnded with ccTouchesEnded and it works now:)