Lua Gideros: Line with touch 2
问题 In my game using Lua and Gideros studio, I want someone to draw a straight line from mouse down to mouse up. Here is my code that doesn't work: local function onMouseDown(event) startx = event.x starty = event.y event:stopPropagation() end local function onMouseUp(event) endx = event.x endy = event.y local line = Shape.new() line:setLineStyle(5, 0x0000ff, 1) line:beginPath() line:moveTo(startx,starty) line:lineTo(endx,endy) line:endPath() event:stopPropagation() end place:addEventListener