1.
SelectorProtocol 修改为:CCObject
2.
CCTouchDispatcher::sharedDispatcher()
修改为:
CCDirector::sharedDirector()->getTouchDispatcher()
3.
error C2039: 'view' : is not a member of 'cocos2d::CCTouch'
分析:源码中的CCPoint location = touch->locationInView(touch->view());这一句过时了。修改为:
CCPoint location = touch->getLocationInView();
4. CGFloat => float
SelectorProtocol 修改为:CCObject
2.
CCTouchDispatcher::sharedDispatcher()
修改为:
CCDirector::sharedDirector()->getTouchDispatcher()
3.
error C2039: 'view' : is not a member of 'cocos2d::CCTouch'
分析:源码中的CCPoint location = touch->locationInView(touch->view());这一句过时了。修改为:
CCPoint location = touch->getLocationInView();
4. CGFloat => float
本文详细解析了Cocos2d-x游戏引擎中SelectorProtocol修改、CCTouchDispatcher使用、过时代码替换及CGFLoat转换为float等关键优化点与常见错误解决策略,提供了一套高效的游戏开发实践指南。
223

被折叠的 条评论
为什么被折叠?



