need some help

i’m trying to make an drawing application. and i use code from sample code “multi punk” which i changed a bit :

 randImage = diskGfx[math.random( 1, 3 )]  
 allDisks[#allDisks + 1] = display.newImage( randImage )  
 local disk = allDisks[#allDisks]  
 disk.x = event.x; disk.y = event.y  
 disk.rotation = math.random( 1, 260 )  
 disk.xScale = 0.8; disk.yScale = 0.8  
  

but the problem:
if i move my finger slowly, i can make a perfect line…but if i move my finger really fast, i will left space between circle…

do you all mind to help me a bit? [import]uid: 33180 topic_id: 9531 reply_id: 309531[/import]

I made one, I would recommend using the display.newLine function, and the calling append of that line on phase == “moved”, this has several advantages, including easy width and color control. Also it should be faster, but I’m just guessing there.

BUT, if you want the crazy dotted line thing, what you can do to make sure you have a filled in line is at every step, draw a disk every few intervals between your current position and your last position.

Here’s some non functional code to give you an idea:

for t=0,1,0.1 do  
 x = lastX \* (1-t) + thisX \* t  
 y = lastY \* (1-t) + thisY \* t  
 newDisk( x, y )  
end  

the 0.1 part should be changed to reflect the actual distance between lastPoint and thisPoint. but yeah thats the idea.

I would still go with the append line idea for a drawing app.

-Angelo [import]uid: 12822 topic_id: 9531 reply_id: 34817[/import]

this is a duplicate entry.
see my other post as well.

uses drawline like Angelo says.

c. [import]uid: 24 topic_id: 9531 reply_id: 34899[/import]

thanks Angelo and carlos, i’ll try it…^^ [import]uid: 33180 topic_id: 9531 reply_id: 34917[/import]