local function onTouchBegan(x, y) 层单击事件
end
local function onTouchMoved(x, y)
end
local function onTouchEnded(x, y)
print("哈哈哈")
end
local function onTouch(eventType, x, y) --触发函数
if eventType == "began" then
return true
elseif eventType == "ended" then
return onTouchEnded(x, y)
end
end
layer:setTouchEnabled(true)
layer:registerScriptTouchHandler(onTouch)
quick_cocos2dx 点击事件,布布扣,bubuko.com
原文地址:http://www.cnblogs.com/ywnn/p/3790260.html