如何将整个显示屏注册为事件监听器?
答案 0 :(得分:3)
创建main.lua并添加它。
function drawLine( event )
if(event.phase == "ended") then
line = display.newLine(event.xStart, event.yStart, event.x, event.y)
line:setColor(255,0,0)
line.width = 5
end
end
Runtime:addEventListener("touch", drawLine)
答案 1 :(得分:0)
将事件侦听器添加到Runtime