阅读背景:

cocos3——3.触屏事件

来源:互联网 

1.c++:

// set touch
		auto eventDispatcher = Director::getInstance()->getEventDispatcher();
		auto listen = EventListenerTouchOneByOne::create();
		listen->onTouchBegan = CC_CALLBACK_2(SneakyJoystick::ccTouchBegan, this);
		listen->onTouchMoved = CC_CALLBACK_2(SneakyJoystick::ccTouchMoved, this);
		listen->onTouchEnded = CC_CALLBACK_2(SneakyJoystick::ccTouchEnded, this);
		listen->onTouchCancelled = CC_CALLBACK_2(SneakyJoystick::ccTouchCancelled, this);
		eventDispatcher->addEventListenerWithSceneGraphPriority(listen, this);// set touch
		auto eventDispatcher



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: