Hey SGS - I added some print commands to your code and played around with it a bit more on my machine:
[lua]local line = nil
touchListener = function(event)
if event.phase == “moved” then
print(“moved”)
if line then
print(“append”, event.x, event.y)
line:append(event.x,event.y)
else
print(“began”, event.xStart, event.yStart, event.x, event.y)
line = display.newLine(event.xStart, event.yStart, event.x, event.y)
line:setStrokeColor (1,1,1)
line.strokeWidth = 20
end
elseif event.phase == “ended” then
print(“ended”)
line:append(event.x,event.y)
end
return true
end
Runtime:addEventListener(“touch”, touchListener)[/lua]
I can’t say I’ve figured out what the issue is but I have two observations when I look at what’s been drawn on the simulator screen and what’s been printed to the console. Here is one example where I pressed down the mouse, moved the mouse (pretty quickly) and then released the mouse:
Jun 06 08:57:39.339 moved began 150 86 150 86 Jun 06 08:57:39.363 moved append 150 86 Jun 06 08:57:39.393 moved append 150 86 Jun 06 08:57:39.394 moved append 150 86 moved append 150 86 Jun 06 08:57:39.397 moved append 150 86 Jun 06 08:57:39.425 moved append 150 86 Jun 06 08:57:39.425 moved append 150 86 moved append 150 86 Jun 06 08:57:39.429 moved append 150 86 Jun 06 08:57:39.456 moved append 150 86 Jun 06 08:57:39.456 moved append 150 86 moved append 150 86 Jun 06 08:57:39.462 moved append 150 86 Jun 06 08:57:39.490 moved append 150 86 Jun 06 08:57:39.491 moved append 150 86 moved append 150 86 Jun 06 08:57:39.494 moved append 150 86 Jun 06 08:57:39.515 moved Jun 06 08:57:39.515 append 150 86 moved append 150 86 Jun 06 08:57:39.549 moved append 150 86 Jun 06 08:57:39.549 moved append 150 86 moved append 150 86 Jun 06 08:57:39.553 moved Jun 06 08:57:39.553 append 150 86 Jun 06 08:57:39.560 moved append 150 86 Jun 06 08:57:39.591 moved append 150 86 Jun 06 08:57:39.592 moved append 150 86 moved append 152 88 moved append 152 88 moved append 154 92 Jun 06 08:57:39.596 moved append 154 92 Jun 06 08:57:39.596 moved append 156 96 Jun 06 08:57:39.623 moved append 156 96 Jun 06 08:57:39.624 moved append 158 100 moved append 158 100 moved append 160 102 moved append 160 102 moved append 162 106 Jun 06 08:57:39.628 moved Jun 06 08:57:39.628 append 162 106 moved append 162 110 Jun 06 08:57:39.646 moved append 162 110 Jun 06 08:57:39.646 moved append 164 114 moved append 164 114 moved append 166 118 Jun 06 08:57:39.686 moved append 168 128 Jun 06 08:57:39.686 moved append 168 128 moved append 170 132 moved append 170 132 moved append 170 142 moved append 170 142 moved append 172 156 Jun 06 08:57:39.691 moved append 172 156 Jun 06 08:57:39.691 moved append 172 168 Jun 06 08:57:39.711 moved append 172 168 Jun 06 08:57:39.711 moved append 172 182 moved append 172 182 moved append 174 188 Jun 06 08:57:39.741 moved append 174 188 Jun 06 08:57:39.741 moved append 174 202 moved append 174 202 moved append 174 214 moved append 174 214 moved append 176 228 moved append 176 228 moved append 178 238 Jun 06 08:57:39.747 moved append 178 238 Jun 06 08:57:39.770 moved append 178 244 Jun 06 08:57:39.771 moved append 178 244 moved append 180 250 moved append 180 250 moved append 180 258 Jun 06 08:57:39.775 moved append 180 258 Jun 06 08:57:39.775 moved append 180 262 Jun 06 08:57:39.779 moved append 180 262 Jun 06 08:57:39.798 moved append 180 264 Jun 06 08:57:39.799 moved append 180 264 moved append 180 266 moved append 180 266 moved append 180 266 Jun 06 08:57:39.804 ended
Here is what was drawn on the simulator screen:
<Hmmm … when I try to insert my screenshot in this post I keep getting the error ‘You are not allowed to use that image extension on this community’ no matter whether I use png or jpeg. Not sure why that is or what to do about it … >
So what was drawn on the screen is just a small triangle, and when I look at the console output I see lots of repetitions, i.e. identical x-y-pairs being appended, starting with the x-y-pair “156 86”.
What this makes me wonder is whether the Corona append function is buggy and doesn’t work well when you keep appending the same point to a line. I realise though that this doesn’t explain why the code seems to be working fine on your machine.