cocos2d-x-3.0alpha1触摸事件

cocos2d-x-3.0alpha1 touch events?

本文关键字:事件 触摸 0alpha1 cocos2d-x-3      更新时间:2023-10-16

我刚刚开始使用cocos2d-x,并且正在使用3.0 alpha 1版本。下面的代码试图设置为处理onTouchBegan事件,但我在Xcode中遇到一个错误,上面写着"嵌套名称说明符中命名的不完整类型'cocos2d::EventListenerTouch'。

auto _touchListener = EventListenerTouch::create(Touch::DispatchMode::ONE_BY_ONE);
_touchListener->setSwallowTouch(true);
_touchListener->onTouchBegan = [](Touch* touch, Event* event){ this->touchMe(touch, event); return true;};

您可以改用EventListenerTouchOneByOne::create()

但是我不知道为什么不能使用EventListenerTouch