-
-
Notifications
You must be signed in to change notification settings - Fork 492
line
TimotheeGreg edited this page Aug 24, 2023
·
13 revisions
line(x0, y0, x1, y1, color)
- x0, y0 : the coordinates of the start of the line
- x1, y1 : the coordinates of the end of the line
- color: the index of the color in the current palette
Draws a straight line from point (x0,y0) to point (x1,y1) in the specified color.
-- 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
TIC-80 tiny computer https://tic80.com | Twitter | Telegram | Terms
Built-in Editors
Console
Platform
RAM & VRAM | Display | Palette | Bits per Pixel (BPP) |
.tic
Format | Supported Languages
Other
Tutorials | Code Snippets | Libraries | External Tools | FFT
API
- BDR (0.90)
- BOOT (1.0)
- MENU
- OVR (deprecated)
- SCN (deprecated)
- TIC
- btn & btnp
- circ & circb
- clip
- cls
- elli & ellib (0.90)
- exit
- fget & fset (0.80)
- font
- key & keyp
- line
- map
- memcpy & memset
- mget & mset
- mouse
- music
- peek, peek4
- peek1, peek2 (1.0)
- pix
- pmem
- poke, poke4
- poke1, poke2 (1.0)
- rect & rectb
- reset
- sfx
- spr
- sync
- ttri (1.0)
- time
- trace
- tri & trib (0.90)
- tstamp (0.80)
- vbank (1.0)