2011-03-14 84 views

回答

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

0

的添加事件偵聽器運行時