displayLine.append doesn't work realtime (unless line.width is set to eg line.width+0.0000001)

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]

actually sorry the subject is wrong… the smallest number i can add to force render is 0.000001 as per the code [import]uid: 6645 topic_id: 4494 reply_id: 14076[/import]

trust me when i tell you that’s not going to work

try this instead

http://developer.anscamobile.com/assets/main.lua.zip

if you can do a video to show our members that would be great.

carlos [import]uid: 24 topic_id: 4494 reply_id: 14083[/import]

Is this really the most efficient way to draw a line from a user’s touch? Seems like not only way to many points but the worse seems to be the redrawing the line every move just feels wrong. If I did this using just by creating a circle with each touch I can simulate a line on the screen without having to redraw each circle.

Why is append not real time?

If you have the line and it has already been drawn why can’t we just keep adding new points that it continues to connect to for us without the developer having to write so much logic. Seem like something a simple a drawing a line with your finger would be so complex when so many other things have been simplified with this SDK. [import]uid: 43562 topic_id: 4494 reply_id: 27814[/import]

This still doesn’t work btw. If you try to draw the line fast then it just freezes and you can no longer draw anything.

Is there not a simplified way to do line drawing and turn the line into a physics object yet? [import]uid: 13974 topic_id: 4494 reply_id: 70084[/import]