Draws a line (a direct path between two points) to the screen. The version of Pline with four parameters draws the line in 2D. To color a line, use the Pstroke function. A line cannot be filled, therefore the Pfill function will not affect the color of a line. 2D lines are drawn with a width of one pixel by default, but this can be changed with the PstrokeWeight function. The version with six parameters allows the line to be placed anywhere within XYZ space. Drawing this shape in 3D with the z parameter requires the P3D parameter.

Link to original Processing doc

Pline is available since version 1.0.0.

See also



// @preview image 150 100 '2D3' PGraphics //new image instance 0xffffffff Pbackground //white background 0xff000000 Pstroke //black stroke (ARGB color) 12 PstrokeWeight //stroke width 12pixels 20 30 80 30 Pline 120 30 Ppoint 6 PstrokeWeight //stroke width 6 pixels 20 50 80 50 Pline 120 50 Ppoint 1 PstrokeWeight //stroke width 1 pixels 20 70 80 70 Pline 120 70 Ppoint Pencode //render the image in a base64 format on the stack