I’m having problem using the ccTouchEnded method or basically any touch method.
I’ve inherited my class from cocos2d::CCTargetedTouchDelegate
In my init method I’ve set:
this~~>setIsTouchEnabled;
My function prototype is declared as below in the class :
virtual void ccTouchEnded;
The function implementation is
void HelloWorld::ccTouchEnded
{
CCPoint touchLocation = touch~~>locationInView( touch->view() );
touchLocation = CCDirector::sharedDirector()->convertToGL( touchLocation );
}
I’ve placed a breakpoint in the ccTouchEnded method but it never reaches that point.
Any idea what I might be doing wrong
Thanks
ccTouchEnded is for targeted touch delegate.
While setIsTouchEnabled(true) opens the standard touch delegate.
You must override ccTouchesEnded method inherited from CCStandardTouchDelegate in CCTouchDelegateProtocol.h. Take care of the “touches” but not “touch”
Ok I’ve got it working. I didn’t check what you mentioned yet. I just changed the function prototype nd defintion to :
ccTouchesEnded(cocos2d::CCSet pTouches, cocos2d::CCEventpEvent)