电晕触摸事件?

时间:2011-03-14 14:32:25

标签: lua corona

如何将整个显示屏注册为事件监听器?

2 个答案:

答案 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)

请务必查看此网站http://developer.anscamobile.com/resources/docs

答案 1 :(得分:0)

将事件侦听器添加到Runtime