Reference   Language | Libraries | Comparison | Changes

ArduinoGraphics : ArduinoGraphics class

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();

See Also



Reference Home

Corrections, suggestions, and new documentation should be posted to the Forum.

The text of the Arduino reference is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.