line

v0.1.7
line(x1, y1, x2, y2);

Draw a line on the screen.

Arguments

x1The x position of the first point
y1The y position of the first point
x2The x position of the second point
y2The y position of the second point

function setup()
  createWindow(200, 200);
end

function draw()
  background('purple');
  stroke('white');

  -- diagonal line from top-left to mouse pointer
  line(0, 0, mouseX, mouseY);
end

Output

See line in shapes.h