I got into trouble of this function, and I don't know what is the meaning of that:
menuItem1->setCallback([&](cocos2d::Ref *sender)
Enter the function, the param is ccMenuCallback&:
/** set the callback to the menu item
* @code
* In js,can contain two params,the second param is jsptr
* @endcode
* @lua NA
*/
void setCallback(const ccMenuCallback& callback);
And
typedef std::function<void(Ref*)> ccMenuCallback;
Aucun commentaire:
Enregistrer un commentaire