Last active
December 12, 2015 03:18
-
-
Save syuhari/4705616 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "CCTestLayer.h" | |
USING_NS_CC; | |
USING_NS_CC_EXT; | |
SEL_MenuHandler CCTestLayer::onResolveCCBCCMenuItemSelector(CCObject * pTarget, CCString * pSelectorName) | |
{ | |
CCB_SELECTORRESOLVER_CCMENUITEM_GLUE(this, "menuTapped", CCTestLayer::menuTapped); | |
return NULL; | |
} | |
void CCTestLayer::menuTapped(CCObject *pSender, CCControlEvent pCCControlEvent) { | |
CCLOG("button tapped"); | |
} | |
SEL_CCControlHandler CCTestLayer::onResolveCCBCCControlSelector(CCObject *pTarget, CCString*pSelectorName) { | |
return NULL; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef __TestBuilder__CCTestLayer__ | |
#define __TestBuilder__CCTestLayer__ | |
#include "cocos2d.h" | |
#include "cocos-ext.h" | |
class CCTestLayer : public cocos2d::CCLayer, public cocos2d::extension::CCBSelectorResolver | |
{ | |
virtual cocos2d::SEL_MenuHandler onResolveCCBCCMenuItemSelector(CCObject * pTarget, cocos2d::CCString * pSelectorName); | |
virtual cocos2d::extension::SEL_CCControlHandler onResolveCCBCCControlSelector(cocos2d::CCObject * pTarget, cocos2d::CCString * pSelectorName); | |
void menuTapped(CCObject *pSender, cocos2d::extension::CCControlEvent pCCControlEvent); | |
public: | |
CREATE_FUNC(CCTestLayer); | |
}; | |
class TestBuilderLoader : public cocos2d::extension::CCLayerLoader { | |
public: | |
CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(TestBuilderLoader, loader); | |
protected: | |
CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(CCTestLayer); | |
}; | |
#endif /* defined(__TestBuilder__CCTestLayer__) */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment