Advertisement
Guest User

gui

a guest
Jan 18th, 2018
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.45 KB | None | 0 0
  1. m = peripheral.wrap("top")
  2. mX,mY = m.getSize()
  3.  
  4. function clear()
  5. m.setBackgroundColor(colors.red)
  6. m.clear()
  7. m.setCursorPos(1,1)
  8. end
  9.  
  10. function drawText(x,y,text,color_text,color_bg)
  11. m.setBackgroundColor(color_bg)
  12. m.setTextColor(color_text)
  13. m.setCursorPos(x,y)
  14. m.write(text)
  15. end
  16.  
  17. function drawLine(x,y,length,size,color_bar)
  18. for yPos = y, y+size-1 do
  19. m.setBackgroundColor(color_bar)
  20. m.setCursorPos(x,yPos)
  21. m.write(string.rep(" ",length))
  22. end
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement