Line draw between two points

Hello, is it possible to draw a line automatically between two points by giving X and Y parameters?

Yes.

DrawLine(x1,y1,x2,y2) Draws a line between the given coordinates on the canvas.

Just use the coordinates of the two ends of the line you hope to draw. :wink:

Hi thanks🌹

Hello again. I have drawn a triangle with a canvas and three balls, and I want the sides of the triangle to move when I move the vertices of a triangle, but the previously drawn sides remain. What is the solution? I do something similar to the pattern in smartphones. Thank you.

When you draw a line on the Canvas, the line is persistent until you erase it. To erase the line you have to redraw the original line and replace it with a line set to the color of the background. Awkward but this is how to erase.

Is it not possible to make the color of the line transparent?

You can try that and let us know if it works. I do not know if it will work that way. :cry:

Hi,very thanks🌹

Hello, I used from (call canvas.clear) and it worked very well.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.