You will require two images, but they are just a circle and a square so can easily be created by your program if you want.
You only need the circle image if you want curved ends on your line.
You need two sprites, for the two images which should be created before hand. I have used sprites 1 and 2 here, but you can use any numbers. Sprite 1 is the circle image, sprite 2 the square.
Both images should be 100x100 (or you won't be able to get every size of line).
The square should fill the whole image, and be filled white.
The circle should fill its image, and be filled white.
The circle should have a transparent background.
Here are the images I used:
x1,y1 define the start of the line
x2,y2 define the end of the line
r,g,b define the colour
thickness defines the width of the line
function draw_line(x1,y1,x2,y2,r as byte, g as byte, b as byte, thickness as byte)
scale sprite 1,thickness
set sprite diffuse 1,r,g,b
paste sprite 1,x1,y1
paste sprite 1,x2,y2
x3 = x1-x2
y3 = y1-y2
ang# = 180-atanfull(x3,y3)
len# = sqrt(x3*x3+y3*y3)
stretch sprite 2,thickness,len#
rotate sprite 2,ang#
set sprite diffuse 2,r,g,b
paste sprite 2,x1,y1
endfunction
enjoy