-
-
Notifications
You must be signed in to change notification settings - Fork 492
Display
TIC-80 has a native screen resolution of 240 pixels wide by 136 pixels tall, giving an aspect ratio of 30:17. This resolution is maintained when resizing, so any reference in code is considered to be at this "virtual" resolution, regardless of window size or monitor resolution.
The screen origin is at top-left, with x coordinates running left to right and y coordinates from top to bottom. Coordinates are specified as (x,y) pairs.
- (0,0) is the top left
- (239,135) is the bottom right
-- title: coordinate system
-- author: PaulR
-- script: lua
function TIC()
cls(15)
poke(0x03FF8, 0)
rectb(0,0,240,136,2)
line(10,20,230,20,6)
line(230,20,230-7,20-3,6)
line(230,20,230-7,20+3,6)
line(10,20,10,120,6)
line(10,120,10-3,120-6,6)
line(10,120,10+3,120-6,6)
rect(0,0,2,2,12)
rect(238,0,2,2,12)
rect(0,134,2,2,12)
rect(238,134,2,2,12)
print("0, 0",5,5,12)
print("239, 0",205,5,12)
print("0, 135",5,125,12)
print("239, 135",194,125,12)
print("x",116,20,6,false,2)
print("y",20,70,6,false,2)
end
When the actual window size is not a perfect match to the aspect ratio a border will be drawn around the outside. This border color can be modified by poking to BORDER COLOR
in RAM:
-- border register is in VRAM 0
vbank(0)
-- set the border color to palette index 10
poke(0x03FF8, 10)
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)