Detect touch Cocos2d-x

Posted by James Dunay on Stack Overflow See other posts from Stack Overflow or by James Dunay
Published on 2012-06-21T15:06:27Z Indexed on 2012/06/21 15:16 UTC
Read the original article Hit count: 151

Filed under:
|
|
|
|

I'm using Cocos2d-x and trying to detect touches in my HelloWorld project. Though I'm having no luck.

.h

class HelloWorld : public CCLayer{

private:
    CCSpriteBatchNode * _batchNode;
    CCSprite *_turkey;
    virtual void ccTouchesBegan(cocos2d::CCSet* touches, cocos2d::CCEvent* event);

.ccp

void HelloWorld::ccTouchesBegan(cocos2d::CCSet* touches, cocos2d::CCEvent* event){
    CCLog("this");
}

but the thing is that when I click the screen 'this' never shows up in the log. What am i missing here?

thanks!

© Stack Overflow or respective owner

Related posts about iphone

Related posts about c++