cocos2d-x lua d出框

cocos2d-x lua d出框,第1张

概述cocos2d-x,点击出现d出窗口,如何将下面层的点击事件禁掉?需要设置 listener:setSwallowTouches(true),这样就不会触发下一层的事件,还有在onTouchBegan中返回true 如 local layerColor=Layer2.new() local function onTouchBegan(touch, event) return true

cocos2d-x,点击出现d出窗口,如何将下面层的点击事件禁掉?需要设置Listener:setSwallowtouches(true),这样就不会触发下一层的事件,还有在ontouchBegan中返回true


	local layercolor=Layer2.new()		 local function ontouchBegan(touch,event)	 return true	 end		    local Listener=cc.EventListenertouchOneByOne:create()    Listener:setSwallowtouches(true)    Listener:registerScriptHandler(ontouchBegan,cc.Handler.EVENT_touch_BEGAN)    local eventdispatcher = layercolor:getEventdispatcher()    eventdispatcher:addEventListenerWithSceneGraPHPriority(Listener,layercolor)

总结

以上是内存溢出为你收集整理的cocos2d-x lua d出框全部内容,希望文章能够帮你解决cocos2d-x lua d出框所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1005816.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-22
下一篇 2022-05-22

发表评论

登录后才能评论

评论列表(0条)

保存