Quantcast
Channel: Cocos中文社区 - 最新主题
Viewing all articles
Browse latest Browse all 88737

EventListenerTouchAllAtOnce

$
0
0

@3464285 写道:

local function onBegan (args)
print("----1")
end
local function onMoved (args)
print("----2")
end
local function onEnded (args)
print("----3")
end
local layer=cc.Layer:create()
local _eventlistener=cc.EventListenerTouchOneByOne:create()
eventlistener:registerScriptHandler(onBegan,cc.Handler.EVENTTOUCH_BEGAN)
eventlistener:registerScriptHandler(onMoved,cc.Handler.EVENTTOUCH_MOVED)
eventlistener:registerScriptHandler(onEnded,cc.Handler.EVENTTOUCH_ENDED)
local _dispatcher=layer:getEventDispatcher()
dispatcher:addEventListenerWithSceneGraphPriority(eventlistener,layer)
cocos2dx 3.13.1 创建了一个lua项目 然后写了一个监听 结果只走了 onBegan函数 后面的moved还有ended函数没有进 是我姿势不对吗

帖子: 2

参与者: 1

阅读整个主题


Viewing all articles
Browse latest Browse all 88737

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>