cocos2d-x触摸事件addTouchEventListener在2.x和3.x的区别

前端之家收集整理的这篇文章主要介绍了cocos2d-x触摸事件addTouchEventListener在2.x和3.x的区别前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
 @H_404_1@

//老版本cocos2d-x 2.x

addTouchEventListener(this, toucheventselector(MyLayer::touchEvent));

void touchEvent(cocos2d::Ref* pSender,cocos2d::ui::TouchEventType type)


//新版本cocos2d-x 3.x

addTouchEventListener( CC_CALLBACK_2( MyLayer::touchEvent,this ));

void touchEvent(cocos2d::Ref* pSender,cocos2d::ui::Widget::TouchEventType type);

原文链接:https://www.f2er.com/cocos2dx/338894.html

猜你在找的Cocos2d-x相关文章