Need some advice on how I can tighten up the quality of the free hand line drawing.
This is my current code: -
if event.phase == "began" or event.phase == "moved" then if oldx ==nil then oldx = event.x oldy = event.y DrawHistory[#DrawHistory+1] = display.newGroup() end local line = display.newLine( oldx, oldy, event.x, event.y ) line.strokeWidth = DrawWidth line:setStrokeColor( DrawColour[1],DrawColour[2],DrawColour[3]) DrawHistory[#DrawHistory]:insert(line) oldx = event.x oldy = event.y end
This works, but if the line width is quiet high the effect is not great: -
https://gyazo.com/859f73c96cf9cc9bb7c36d7ef43db1e1
Not sure how to tighten it up. I have tried reducing the render rate by introducing a tick counter so that it does not render all the time. This seems to be better.
What I may try is using rectangles rather than a line?
Any advice would be greatly appreciated…