Last active
December 16, 2016 08:09
-
-
Save kkabdol/ff5ff30c89767a51b5d5cbcf3bdc2865 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // lamda example | |
| void lamdaA ( cocos2d::Node* node ) | |
| { | |
| auto button = node->getChildByName< cocos2d::ui::Button* >( "Button_team" ); | |
| if( button ) | |
| { | |
| button->addTouchEventListener( [ = ]( cocos2d::Ref*, cocos2d::ui::Widget::TouchEventType type ) { | |
| if( type == cocos2d::ui::Widget::TouchEventType::ENDED ) { | |
| // do something | |
| } | |
| } ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment