i’ve got a function to draw a poly line with the mouse (i was trying to add it to Martian Control). but the polyLine doesnt render immediately during drawing, unless i had a minute amount of width eg [lua]tempLine.width=tempLine.width+0.000001[/lua]
[lua]local tempLine
local function runTouch(event)
if(event.phase==“began”) then
if(tempLine==nil) then
print(“add new line”)
tempLine=display.newLine(event.x, event.y, event.x, event.y)
tempLine:setColor(255,0,0,255)
tempLine.width=3
end
elseif(event.phase==“moved”) then
print(“moved to “…event.x…”,”…event.y)
tempLine:append(event.x,event.y)
– TAKE THIS OUT AND IMMEDIATE DRAWING FAILS
tempLine.width=tempLine.width+0.000001
elseif(event.phase==“ended”) then
print(“line added”)
tempLine.parent.remove(tempLine)
tempLine=nil
end
end
Runtime:addEventListener(“touch”, runTouch)[/lua] [import]uid: 6645 topic_id: 4494 reply_id: 304494[/import]