It looks like you're new here. If you want to get involved, click one of these buttons!
local theLine= Shape function Main() theLine= DrawLine(10,10,application:getDeviceWidth()/2,10,5,1,0xffffff) stage:addChild(theLine) end function onTouchMove(event) theLine:clear() ChangeLine( theLine,10,10,event.touch.x,event.touch.y,5,1,0xffffff) end function DrawLine(x1, y1, x2, y2, width, alpha, rgbcolor) local line = Shape.new() line:setLineStyle(width, rgbcolor, alpha) line:beginPath() line:moveTo(x1,y1) line:lineTo(x2, y2) line:endPath() return line end function ChangeLine(which, x1, y1, x2, y2, width, alpha, rgbcolor) if which == theLine then theLine:setLineStyle(width, rgbcolor, alpha) theLine:beginPath() theLine:moveTo(x1,y1) theLine:lineTo(x2, y2) theLine:endPath() end end Main() stage:addEventListener(Event.TOUCHES_MOVE, onTouchMove) application:setBackgroundColor(0x000000) |
Dislikes: pmorsand
Comments
#MakeABetterGame! "Never give up, Never NEVER give up!" - Winston Churchill
I don't think I would have thought twice about this, except before Gideros, I was using a different environment and had near 0 lag doing the same thing on the phone.