polyline points

Hello,

I have the following code:

line=display.newLine(10,15,100,200)

This will draw a line between point A(10,15) and point B(100,200). How can I:
-later on get point B coordinates having access only to the line variable
-be able to modify the point B

Thank you,
Dan [import]uid: 17925 topic_id: 15411 reply_id: 315411[/import]

keep the points in an array. then access the array points - then recreate the poly-line.

.c [import]uid: 24 topic_id: 15411 reply_id: 56936[/import]

Hello,

I want to access those values directly from theline variable. Also side question: What’s the optimal way to update the line if i do like you say above? line:removeSelf() then line=displayNewLine(…) or?

Thank you,
Dan [import]uid: 17925 topic_id: 15411 reply_id: 56956[/import]

yes- take a look at my bezier demo in the code-exchange.

does just that. recreates the line based on the edited anchor/handle points.

.c
[import]uid: 24 topic_id: 15411 reply_id: 56957[/import]