Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/210.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 在电晕中画线并擦掉_Android_Iphone_Coronasdk - Fatal编程技术网

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)