Hi,
I have some problem with implementing the touch in cocos2d-x. I have implemented function in the same form as in the Paddle.cpp in the Touch tests.
It looks like this:
void Paddle::ccTouchEnded(CCTouch* touch, UIEvent* event);
I used the debugger and I see that when I touch the screen with mouse the touchEnded event doesn’t work. It works well when I run the Touch test.
Please, help me to implement it in right way or give some other solutions.
Edit: I have solved the problem! But I didn’t know at all which thing that I have changed solved it…
I have created such function:
void HelloWorld::ccTouchesEnded(cocos2d::NSSet pTouches, cocos2d::UIEvent event);
and declared this:
bool containsTouchLocation(cocos2d::CCTouch* touch);
and the HelloWorld class cannot inherit from CCTargetedTouchDelegate. (in my case)