Fandom

Pico-8 Wiki

Line

162pages on
this wiki
Add New Page
Comments0 Share
line( x0, y0, x1, y1, [col] )

Draws a line between two points.

x0
The x coordinate of the start of the line.
y0
The y coordinate of the start of the line.
x1
The x coordinate of the end of the line.
y1
The y coordinate of the end of the line.
col
The color of the line. If omitted, the color from the draw state is used.

Examples Edit

line(63, 0, 126, 63, 8)
line(126, 63, 63, 126, 8)
line(63, 126, 0, 63, 8)
line(0, 63, 63, 0, 8)

-- draw 20 white lines in random locations
color(7)
for x=1,20 do
  line(rnd(128), rnd(128), rnd(128), rnd(128))
end
Line-example-1
Line-example-2

See also Edit

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.