[Unsolved] To draw a 2D line on the screen as a GUI

The title says it all. Just how would I do that? I’ve got a formula that will draw the line in the right place but how would I draw my line? Is it good practice to implement a GUI this way?

EDIT: Oops! I forgot to put this in the right forum! I just need to draw this line every time the mouse moves… not sure if that falls under GUI or scripting either!

You can try the solution used here