Advertisement
Guest User

Untitled

a guest
Aug 16th, 2017
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. -- declare peripherals
  2. local peripherals = {"BigReactors-Reactor_0"}
  3.  
  4. local bridge = peripheral.wrap("right")
  5.  
  6. -- create design
  7.  
  8. -- create layout once, so that the design isn't being redrawn all the time
  9. function addTextNode(x, y, dataTable, vSpacing, textColor)
  10. -- draw text that conforms to rigid bounds
  11. for k, v in pairs(dataTable) do
  12. bridge.addText(x, y+vSpacing, v, textColor)
  13. end
  14. end
  15.  
  16. function addTextBoxNode(x, y, w, h, opacity, bgColor, padding, dataTable, textColor)
  17. bridge.addBox(x, y, w, h, bgColor, opacity)
  18.  
  19. bridge.addTextNode(x+padding, y+padding, dataTable, 10, textColor)
  20. end
  21.  
  22. -- command / chat message responses
  23.  
  24. function commandListener()
  25.  
  26. end
  27.  
  28. local tableOfData = {"First value", "Second value", "Third value"}
  29.  
  30.  
  31. addTextBoxNode(10, 10, 100, 100, 1, #00ff00, 10, tableOfData, #00ffff)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement