-
-
Notifications
You must be signed in to change notification settings - Fork 492
line
Denis Maslennikov edited this page Nov 13, 2017
·
13 revisions
line x0 y0 x1 y1 color
- x0 : the x coordinate where the line start
- y0 : the y coordinate where the line start
- x1 : the x coordinate where the line end
- y1 : the y coordinate where the line end
- color: the index of the desired color in the current palette
It draw a straight colored line from (x0,y0) point to (x1,y1) point.
(and very little math)
-- 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)