Android 在电晕中画线并擦掉
我用下面的代码画了一条线 但如果手指碰到同一条线,我想抹掉这条线。。有什么想法吗Android 在电晕中画线并擦掉,android,iphone,coronasdk,Android,Iphone,Coronasdk,我用下面的代码画了一条线 但如果手指碰到同一条线,我想抹掉这条线。。有什么想法吗 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:addEventLis
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)
简单。将该线设为传感器,用户一接触该线,就将其从组中移除或删除该对象
physics.addBody( line, { isSensor = true } )
someGroup:insert(line)
line.collision = removeLine --some function that removes the line from the group someGroup
line:addEventListener(""touch"", line)