QuickMuffin8782-Alt

bufferapitemp

Nov 8th, 2020
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. os.loadAPI("/bufferAPI")
  2.  
  3. local x1, y1 = 1, 1
  4. local x2, y2 = term.getSize()
  5. local buffer = bufferAPI.newBuffer(x1, y1, x2, y2)
  6.  
  7. --[[
  8. All handle functions:
  9. buffer:setBufferSize(x1, y1, x2, y2)
  10. buffer:clear(color)
  11. buffer:setPixel(x, y, c1, c2, char)
  12. buffer:write(x, y, c1, c2, string)
  13. buffer:loadImage(x, y, image, useBlittle)
  14. buffer:loadBox(x1, y1, x2, y2, c1, c2, char)
  15. buffer:loadBorderBox(x1, y1, x2, y2, c1, c2, char)
  16. buffer:loadBorderBoxBlittle(x1, y1, x2, y2, c1, c2, char)
  17. buffer:loadLine(x1, y1, x2, y2, c)
  18. buffer:loadTriangle(x1, y1, x2, y2, x3, y3, c)
  19. buffer:loadCircle(x, y, c1, c2, char, radius)
  20. buffer:drawBuffer(blittleOn) -- For drawing the buffer
  21. ]]--
  22.  
  23. function drawScreen()
  24. -- Load everything into the buffer
  25. buffer:clear(colors.lime)
  26. buffer:write(5, 5, colors.blue, colors.white, "This is text.")
  27. buffer:loadTriangle(8, 6, 4, 15, 20, 12, colors.red)
  28.  
  29. -- Draw the buffer
  30. buffer:drawBuffer(false) -- BlittleOn
  31. end
  32.  
  33. while true do
  34. drawScreen()
  35. -- Do stuff here
  36.  
  37. os.queueEvent("FakeEvent")
  38. os.pullEvent("FakeEvent")
  39. end
Add Comment
Please, Sign In to add comment