Skip to content
paul59 edited this page May 15, 2020 · 10 revisions

TIC coordinate system

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.

TIC coordinate

-- 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
Clone this wiki locally