Advertisement
toast_account_i_made

EasyGui

Jun 13th, 2021 (edited)
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.15 KB | None | 0 0
  1. local mainLoopOn = true
  2.  
  3. local deviceScreenSize = {0, 0} -- this is set to the scren size
  4.  
  5. local devicetype = "none"
  6.  
  7. function LoadPercentSizes()
  8.     if (devicetype == "turtle") then
  9.         deviceScreenSize = {39, 13}
  10.     elseif (devicetype == "computer") then
  11.         deviceScreenSize = {51, 19}
  12.     elseif (devicetype == "pocket") then
  13.         deviceScreenSize = {26, 20}
  14.     end
  15. end
  16.  
  17. function MakeTextBox(x, y, sizex, sizey, boxcol, textcol, data)
  18.     paintutils.drawFilledBox(x, y, x+sizex, y+sizey, boxcol)
  19.  
  20.     term.setCursorPos(x, y+(sizey/2))
  21.  
  22.     turtle.setTextColor(textcol)
  23.     term.write(data)
  24. end
  25.  
  26. function QuitProg()
  27.     mainLoopOn = false
  28.     term.clear()
  29. end
  30.  
  31. -- Aight, start writing past here
  32.  
  33. local devicetype = "turtle" -- this is used for percent - based sizing this can be turtle, computer, pocket is automaticaly set
  34. local isTabbedShell = false -- if this is on a advanced computer and ran in a tabbed shell
  35. LoadPercentSizes() -- percents will round to the nearest factor of screen size
  36.  
  37. term.clear()
  38.  
  39. while mainLoopOn do
  40.     MakeTextBox(0, 0, 20, 10, colours.red, "Hola")
  41.     os.sleep(5)
  42.     QuitProg()
  43. end
  44.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement