Advertisement
Redxone

[Lua - Computercraft] StoneFruit GUI WIP

Jan 10th, 2017
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.81 KB | None | 0 0
  1. local sbc = term.setBackgroundColor
  2. local stc = term.setTextColor
  3. local scp = term.setCursorPos
  4. local line = paintutils.drawLine
  5. local box = paintutils.drawFilledBox
  6. local clr = term.clear
  7. local w,h = term.getSize()
  8. local rw, rh = w/2, h/2
  9.  
  10. sbc(colors.lightBlue)
  11. stc(colors.white)
  12. clr()
  13. line(1,1,w,1,colors.blue)
  14. scp(1,1)
  15. write("Name")
  16. scp(w-6, 1)
  17. write("12:00")
  18. local bw = 10
  19. local bh = 4
  20. local bsy = 8
  21. local bsep = 10
  22. local bc = 4
  23. local color = {
  24.     [0] = colors.lightGray,
  25.     [1] = colors.gray,
  26.     [2] = colors.black,
  27. }
  28. local cind = colors.purple
  29. for i = 0, bc do
  30.     local col = math.abs(i-(bc/2))
  31.     if(col >= 0)then
  32.         cind = color[col]
  33.     else
  34.         cind = colors.black
  35.     end
  36.     box((i*bw)+2,bsy-col,(i*bw)+bsep,bsy+bh-col,cind)
  37.     scp((i*bw)+2,bsy-col)
  38.     write("Game " .. i)
  39. end
  40. os.pullEvent("key")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement