drawgridisometric.lua 630 B

1234567891011121314
  1. -- Draw isometric grid - Copyright 2010 Paulo Silva
  2. -- This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. See <http://www.gnu.org/licenses/>
  3. w,h=getpicturesize();
  4. ok,gsiz,ik=inputbox("draw isometric grid","size",16,0,128,5,"colour",1,0,255,6);
  5. if ok==true then
  6. for y=0,h-1,gsiz do
  7. for x=0,w-1,1 do
  8. putpicturepixel(x,y+(x/2)%gsiz,ik);
  9. end;end
  10. for y=0,h-1,gsiz do
  11. for x=0,w-1,1 do
  12. putpicturepixel(x+((gsiz/2)-1),y+(gsiz-1)-((x/2)%gsiz),ik);
  13. end;end;end