Canvas and Line

Hello all
I would like to ask something and i hope this is the right place to do
Is there a way to draw a line in the way design programs do ?
like:
touch down on a point in canvas to get the start point
and while dragging along canvas only one line will be visible from start point to current point
and finalize the line by touch up.

example
I touch down on X0, Y0
i drag to X1, Y1
I continue drag to X2, Y2 (X0,Y0 - X1, Y1 is erased, X0,Y0 - X2, Y2 is visible)
I continue drag to X3, Y3 (X0,Y0 - X2, Y2 is erased, X0,Y0 - X3, Y3 is visible)
I touch up and the line , X0,Y0 - X3, Y3 becomes red

I hope i was clear.
Thank you all in advance

Niko

Welcome.

Yes that should be possible. Maybe you can tell what kind of app you are trying to make that needs this functionality.

1 Like

@Peter How angry birds make the aiming dotted line ?
something like that but with a straight line instead of an arc

This is a quick way of doing that

4 Likes

@Peter yes but Canvas.Clear… clears all canvas.

concerning canvas and undo see this thread


Taifun