Should line:append update immediately?

In the example below, line:append will not draw until after the touch event has ended, and will not draw at all if the line.width is set before any of the line:append calls.

[code]
local line

function drawLine(event)
if event.phase == ‘began’ then
if line ~= nil then
line:removeSelf()
line = nil
end
line = display.newLine( event.xStart, event.yStart, event.x, event.y )

elseif event.phase == ‘moved’ then

line:append( event.x, event.y )
line:setColor( 155,228,255 )

elseif event.phase == ‘ended’ then
line.width=5

end
end

Runtime:addEventListener( “touch”, drawLine )
[/code] [import]uid: 4596 topic_id: 7995 reply_id: 307995[/import]

u need to put it into a event loop

see my bez code in the code exchange

or the finger draw sample in the code exchange as well

reason u need to put it into an event loop is that while you are appending in a callback you are not allowing the update to fire.

c [import]uid: 24 topic_id: 7995 reply_id: 29401[/import]