Ryan Ward 1b8f63563f The basic stuff is there
Engine and sample code have been added
2018-02-13 13:42:14 -05:00

5 lines
143 B
Plaintext

function InGridY(i,w,h,xs,ys)
local xc,yc=math.floor(w/xs),math.floor(h/ys)
local xi,yi=math.floor((i-1)/yc),(i-1)%yc
return xi*xs,yi*ys
end