Skip to content
BADIM-PC\Vadim edited this page Mar 22, 2017 · 10 revisions

TIC coordinate system

TIC native screen resolution is 240 pixel wide and 136 pixel tall. Proportion is keep when resizing, so any reference in the code is considered to be at the "virtual" native resolution, no matter if you are working with a 4K monitor at full screen.

The coordinate, as most of computers system, start from top-left corner of the screen.

X refer to the horizontal coordinate starting from 0 (left side) to 240 (right side).
Y refer to the vertical coordinate starting from 0 (top side) to 136 (bottom side).

Here a picture:

TIC coordinate

and the code for it:

--Coordinate system demo

function TIC()

 cls(0) 

 --grid x
 for x=0,240,32 do    
   line(x,0,x,136,8)  
 end 
 
 --grid y
 for y=0,136,32 do    
   line(0,y,240,y,8)  
 end
 
 --grid cross
 for x=0,240,32 do
  for y=0,136,32 do
   pix(x,y,6) 
  end 
 end 
 
  --arrows
 line(8,8,210,8,6)
 line(210,8,210-6,8-2,6)
 line(210,8,210-6,8+2,6)
 
 line(8,8,8,120,6)
 line(8,120,8-2,120-6,6)
 line(8,120,8+2,120-6,6) 

 --labels
 for x=0,240,64 do
  for y=0,136,64 do
   print('('..x..','..y..')',x+2,y+2)   
  end 
 end 

 --reference
 print('(X,Y)',12,12) 
end
Clone this wiki locally