EFileTahi-A
Well-known member
How can I draw a line from one point to another?
Imagine that the starting point will be 100,100(x,y(pixels)) to the mouse click coordenates, lets say 345,201 and a line will be drawn from these two points. I can do this all right, but the problem is to make it animated, like seeing the line being drawn from x,y to xx,yy using a timer, so that a every tick will increase the lines size from the starting point to the target point...
If using a line seems to be too tricky, at least I would like to know how to animate a "dot" from the too points...
I guess this will involve Math.Cos / Match.P / Match.Atan / Math.Sin...
Unfortunately my math skills stink...
If there is someone kind enough to teach me this, please...
Imagine that the starting point will be 100,100(x,y(pixels)) to the mouse click coordenates, lets say 345,201 and a line will be drawn from these two points. I can do this all right, but the problem is to make it animated, like seeing the line being drawn from x,y to xx,yy using a timer, so that a every tick will increase the lines size from the starting point to the target point...
Code:
//each line represents a tick... (frame per second)
//x,y means the starting point
//xx,yy means the ending point
// "----" means the line to be drawn
x,y - xx,yy
x,y -- xx,yy
x,y --- xx,yy
x,y ---- xx,yy
x,y ---- xx,yy
x,y ---- xx,yy
x,y ---- xx,yy
x,y ---- xx,yy
x,y ---- xx,yy
x,y ---- xx,yy
x,y ---- xx,yy
x,y ---- xx,yy
x,y ---- xx,yy
x,y ---- xx,yy
x,y ---- xx,yy
x,y ---- xx,yy
x,y ---- xx,yy
x,y ---- xx,yy
x,y ---- xx,yy
x,y ---- xx,yy
x,y --- xx,yy
x,y -- xx,yy
x,y - xx,yy
x,y xx,yy
If using a line seems to be too tricky, at least I would like to know how to animate a "dot" from the too points...
I guess this will involve Math.Cos / Match.P / Match.Atan / Math.Sin...
Unfortunately my math skills stink...
If there is someone kind enough to teach me this, please...
Last edited by a moderator: