ArduinoGraphics - line()

Description

Stroke a line, uses the stroke color set in stroke().

Syntax

YourScreen.line(x1, y1, x2, y2)

Parameters

  • x1: x position of the starting point of the line
  • y1: y position of the starting point of the line
  • x2: x position of the end point of the line
  • y2: y position of the end point of the line

Returns

Nothing

Example

YourScreen.beginDraw();
YourScreen.clear();
YourScreen.stroke(0, 0, 255);
YourScreen.line(0, 0, YourScreen.width() - 1, YourScreen.height() - 1);
YourScreen.endDraw();