Skip to content
Denis Maslennikov edited this page Nov 13, 2017 · 13 revisions

line

line x0 y0 x1 y1 color

Parameters:

Description:

It draw a straight colored line from (x0,y0) point to (x1,y1) point.

Example with only and only lines:

(and very little math)

Example

-- line demo
pi8=math.pi/8
pi2=math.pi*2

t=0
function TIC()
 cls()

 --lines
 for i=t%8,135,8 do
  line(i,0,0,135-i,8)
  line(i,135,135,135-i,6)
  t=t+0.01
 end

 --prism
 for i=t/16%pi8,pi2,pi8 do
  x=68+32*math.cos(i)
  y=68+32*math.cos(i)
  line(135,0,x,y,15)
  line(0,135,x,y,15)
 end

 --Border
 line(0,0,135,0,8)
 line(0,0,0,135,8)
 line(135,0,135,135,6)
 line(0,135,135,135,6)

end
Clone this wiki locally