标签:
local TestScene = class("TestScene", function() return display.newScene("TestScene") end) function TestScene:ctor() local layer = display.newLayer():addTo(self) layer:setTouchEnabled(true) layer:setTouchMode(cc.TOUCH_MODE_ONE_BY_ONE) layer:addNodeEventListener(cc.NODE_TOUCH_EVENT, function (event) local x, y, prevX, prevY = event.x, event.y, event.prevX, event.prevY if event.name == "began" then print("layer began") elseif event.name == "moved" then print("layer moved") elseif event.name == "ended" then print("layer ended") end return true end) end return TestScene
标签:
原文地址:http://www.cnblogs.com/yufenghou/p/4312182.html