Ordiance

Draw Function

Aug 12th, 2021 (edited)
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.40 KB | None | 0 0
  1. mon = peripheral.wrap("top")
  2. function draw(xmin, xmax, ymin, ymax, c)
  3.     mon.setBackgroundColor(c)
  4.     mon.setCursorPos(xmin, ymin)
  5.     if xmax ~= 1 then
  6.         for i = 1, xmax, 1 do
  7.             mon.write(" ")
  8.             mon.setCursorPos(xmin+i, ymin)
  9.         end
  10.     end
  11.     if ymax ~= 1 then
  12.         for k = 1, ymax, 1 do
  13.             mon.write(" ")
  14.             mon.setCursorPos(xmin, ymin+k)
  15.         end
  16.     end
  17.     mon.setBackgroundColor(32768)
  18. end
  19.  
  20.    
Advertisement
Add Comment
Please, Sign In to add comment