I know you can add additional line segments by using ‘append’, but is there any way to either remove segments and/or clear out all segments thereby allowing you to redraw the line?
Thanks [import]uid: 29652 topic_id: 5641 reply_id: 305641[/import]
I know you can add additional line segments by using ‘append’, but is there any way to either remove segments and/or clear out all segments thereby allowing you to redraw the line?
Thanks [import]uid: 29652 topic_id: 5641 reply_id: 305641[/import]
keep an array of coordinates and redraw the (poly)line completely when it changes (ie remove the whole line and recreate it from the array of points)
the user won’t notice [import]uid: 6645 topic_id: 5641 reply_id: 19294[/import]
My situation is that I need to redraw the line every frame. So, what you’re saying is that I need to remove the line from its parent, create another line and add that to the display list every single frame? Sounds pretty like a pretty expensive solution. Or are you saying there is already a way to redraw the line?
Thanks again! [import]uid: 29652 topic_id: 5641 reply_id: 19302[/import]
well you only need to redraw the line if it changes, but if it’s changing every frame then yes you should do tests to see how many segments you can make before it slows down
[import]uid: 6645 topic_id: 5641 reply_id: 19306[/import]
The line I’m drawing does change every frame, but I have no idea what you mean by do tests to see how many segments you can make. I always have a constant four segments for the line. The only thing is that the position of these four segments change every frame.
Ideally, I would do what I do in flash and call line.grahics.clear() and then redraw. Since it sounds like you can only append segments, but not remove, it appears I’m caught in the unfortunate situation where I will have to reinstantiate a line object every frame. I might have to put in a feature request to allow the removal of all segments. [import]uid: 29652 topic_id: 5641 reply_id: 19320[/import]
i mean test performance on the device. it may seem like an “expensive operation” but is it actually slowing your app down? [import]uid: 6645 topic_id: 5641 reply_id: 19327[/import]