I want to have the user draw a line with their finger so an object bounces off of it.

Can this be done? the line drawn with the finger should be a a static physics body
Thanks!

[import]uid: 75779 topic_id: 35899 reply_id: 335899[/import]

Hi,

yes it can be done
http://www.youtube.com/watch?v=v6POepROoUQ

search in the Forum or Code Exchange there is somewhere a function which covers the drawing…
i am not at home right now to provide it to you…

but you are createing static bodies while moving the finger…
the line consist then of small rectangles…
[import]uid: 9592 topic_id: 35899 reply_id: 142720[/import]

Thank you, I believe you are referring to this function
http://developer.coronalabs.com/code/draw-line

I wonder if they used that function in the video you referenced, I am having trouble using it due to the fact if I make a quick swipe gesture with my finger the small rectangles have large spaces in between and the ball will fall through :frowning:

[import]uid: 75779 topic_id: 35899 reply_id: 142748[/import]

I’ve noticed this too. You will have to add code to the physics body generation section if the previous point and the current point in the moved section are too far apart. [import]uid: 22532 topic_id: 35899 reply_id: 143478[/import]

Hi,

yes it can be done
http://www.youtube.com/watch?v=v6POepROoUQ

search in the Forum or Code Exchange there is somewhere a function which covers the drawing…
i am not at home right now to provide it to you…

but you are createing static bodies while moving the finger…
the line consist then of small rectangles…
[import]uid: 9592 topic_id: 35899 reply_id: 142720[/import]

Thank you, I believe you are referring to this function
http://developer.coronalabs.com/code/draw-line

I wonder if they used that function in the video you referenced, I am having trouble using it due to the fact if I make a quick swipe gesture with my finger the small rectangles have large spaces in between and the ball will fall through :frowning:

[import]uid: 75779 topic_id: 35899 reply_id: 142748[/import]

I’ve noticed this too. You will have to add code to the physics body generation section if the previous point and the current point in the moved section are too far apart. [import]uid: 22532 topic_id: 35899 reply_id: 143478[/import]

Hi,

yes it can be done
http://www.youtube.com/watch?v=v6POepROoUQ

search in the Forum or Code Exchange there is somewhere a function which covers the drawing…
i am not at home right now to provide it to you…

but you are createing static bodies while moving the finger…
the line consist then of small rectangles…
[import]uid: 9592 topic_id: 35899 reply_id: 142720[/import]

Thank you, I believe you are referring to this function
http://developer.coronalabs.com/code/draw-line

I wonder if they used that function in the video you referenced, I am having trouble using it due to the fact if I make a quick swipe gesture with my finger the small rectangles have large spaces in between and the ball will fall through :frowning:

[import]uid: 75779 topic_id: 35899 reply_id: 142748[/import]

I’ve noticed this too. You will have to add code to the physics body generation section if the previous point and the current point in the moved section are too far apart. [import]uid: 22532 topic_id: 35899 reply_id: 143478[/import]

Hi,

yes it can be done
http://www.youtube.com/watch?v=v6POepROoUQ

search in the Forum or Code Exchange there is somewhere a function which covers the drawing…
i am not at home right now to provide it to you…

but you are createing static bodies while moving the finger…
the line consist then of small rectangles…
[import]uid: 9592 topic_id: 35899 reply_id: 142720[/import]

Thank you, I believe you are referring to this function
http://developer.coronalabs.com/code/draw-line

I wonder if they used that function in the video you referenced, I am having trouble using it due to the fact if I make a quick swipe gesture with my finger the small rectangles have large spaces in between and the ball will fall through :frowning:

[import]uid: 75779 topic_id: 35899 reply_id: 142748[/import]

I’ve noticed this too. You will have to add code to the physics body generation section if the previous point and the current point in the moved section are too far apart. [import]uid: 22532 topic_id: 35899 reply_id: 143478[/import]