Advertisement
RabaGhast

GUI

Oct 1st, 2015
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.70 KB | None | 0 0
  1. --Desktop
  2. slc = 0
  3. tBarC = 8
  4. tBartC = 1
  5. backColor = 1
  6. term.setBackgroundColor(backColor)
  7. term.clear()
  8.  
  9.  
  10. function titlebar()
  11.   term.setCursorPos(1,1)
  12.   term.setBackgroundColor(tBarC)
  13.   term.setTextColor(tBartC)
  14.   term.clearLine()
  15.   term.setCursorPos(3, 1)
  16.   print("[Begin]")
  17. end
  18.  
  19. function drawDesktop()
  20.   --bground = paintutils.loadImage(".background")
  21.   --paintutils.drawImage(bground, 1, 1)
  22.   titlebar()
  23. end
  24.  
  25. drawDesktop()
  26.  
  27. while true do
  28.   local event, X, Y = os.pullEventRaw()
  29.   if slc == 0 then
  30.     if event == "mouse_click" then
  31.       if X >= 2 and X <= 8 and Y == 1 and button == 1 then
  32.         term.clear()
  33.       else
  34.         drawDesktop()
  35.       end
  36.     end
  37.   end    
  38. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement