Skip to content

Instantly share code, notes, and snippets.

@kkabdol
Last active December 16, 2016 08:09
Show Gist options
  • Select an option

  • Save kkabdol/ff5ff30c89767a51b5d5cbcf3bdc2865 to your computer and use it in GitHub Desktop.

Select an option

Save kkabdol/ff5ff30c89767a51b5d5cbcf3bdc2865 to your computer and use it in GitHub Desktop.
// 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