-
-
Notifications
You must be signed in to change notification settings - Fork 462
coordinate
paul59 edited this page May 15, 2020
·
10 revisions
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) values so (239,135) represents the bottom right pixel.
-- title: coordinate system
-- author: PaulR
-- script: lua
function TIC()
cls(0)
rectb(0,0,240,130,1)
line(16,16,230,16,6)
line(230,16,230-6,16-2,6)
line(230,16,230-6,16+2,6)
line(16,16,16,120,6)
line(16,120,16-2,120-6,6)
line(16,120,16+2,120-6,6)
pix(0,0,12)
pix(239,129,12)
print("(0,0)",3,3,12)
print("(239,129)",194,122,12)
print("x",116,20,6)
print("y",20,60,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)