line()

Bitsbox's line command lets you draw lines between points on the screen. You can specify the line's thickness and color.

You can use the line command with a lot of different parameters, or options.

The most basic usage takes two numbers for x and y. A line will be drawn to that position, from whatever position was most recently drawn to.

    Draws a line to the top-right corner of the screen.
    Then draw from the last position 768,0 to 100,100

If you send in four numbers, it draws from the first coordinate to the second. The following code example draws a triangle.

You can set the appearance of the line with some additional parameters.

    Draw a blue line to 100,500.
    Draw a 10-pixel-wide line to 200,400.
    Draw a 0-pixel-wide (invisible) line to 300,400.
    Draw a tan, 10-pixel-wide line from 0,0 to 200,200.

And you can change line styling for all of the drawing commands if you don't pass coordinates. The first command in this example program sets all lines, circles, and boxes to have 9-pixel tan edges. The third command changes the thickness before a box is drawn.