5 lines
143 B
Plaintext
5 lines
143 B
Plaintext
function InGridX(i,w,h,xs,ys)
|
|
local xc,yc=math.floor(w/xs),math.floor(h/ys)
|
|
local xi,yi=(i-1)%xc,math.floor((i-1)/xc)
|
|
return xi*xs,yi*ys
|
|
end |