Advertisement
kaibochan

testtext.lua

Mar 23rd, 2023 (edited)
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.62 KB | None | 0 0
  1. local gui = require "gui"
  2.  
  3. local paragraph1 =
  4. "Lorem ipsum dolor sit amet, consectetur adipiscing elit.\nPellentesque gravida porttitor elit,"
  5. .."quis blandit erat rutrum in.\nNulla ut rhoncus elit, vel placerat lacus.\nIn hac habitasse pl"
  6. .."atea dictumst.\nDuis non magna felis.\nSed gravida leo rhoncus felis imperdiet lacinia.\nEtiam"
  7. .." vel lorem ligula.\nSuspendisse fringilla ante massa, dictum aliquam sem hendrerit sed.\nNull"
  8. .."am et auctor massa, in accumsan justo.\nCurabitur lobortis dignissim vehicula.\nSed ornare sa"
  9. .."pien tortor, at pellentesque est consequat eget.\nNulla scelerisque aliquam augue, id dapibu"
  10. .."s erat posuere eu.\nProin vel suscipit risus, quis feugiat nisi.\nNam ut metus ut enim bibend"
  11. .."um tempor.\nNam tincidunt efficitur massa.\nSed pulvinar nibh eget ullamcorper tempus.\nIn a o"
  12. .."dio eget neque varius hendrerit pellentesque quis ipsum.\n\n"
  13.  
  14. local paragraph2 =
  15. "Ut a velit felis.\nMauris erat sapien, pharetra non libero id, auctor vulputate mauris.\nSed "
  16. .."at ullamcorper ante.\nUt nec odio eu eros sodales tempus.\nMaecenas consequat lacus in enim c"
  17. .."ondimentum imperdiet.\nVivamus dapibus auctor leo, eu convallis tortor condimentum eu.\nDonec"
  18. .." ornare libero a tincidunt sodales.\nMorbi elementum odio congue arcu convallis feugiat.\nNam"
  19. .." justo nunc, ullamcorper eget urna ut, fringilla ornare sem.\nFusce bibendum mi nec diam tem"
  20. .."por, a sodales elit ultrices."
  21.  
  22. local width, height = term.getSize()
  23.  
  24. local buffer1 = createBuffer(term, "buffer1", colors.white, 1, 1, math.floor(width / 2), height)
  25. local buffer2 = createBuffer(term, "buffer2", colors.black, math.floor(width / 2) + 1, 1, math.floor(width / 2), height)
  26.  
  27. local txb1 = Textbox:new {
  28.     name = "txb1",
  29.     parent = buffer1,
  30.     buffer = buffer1,
  31.     width = buffer1.width,
  32.     height = buffer1.height,
  33.     padding = 1,
  34.     text = "",--paragraph1,
  35.     backgroundColor = colors.red,
  36.     textColor = colors.orange,
  37.     horizontalAlignment = align.left,
  38.     verticalAlignment = align.top,
  39.     wrapText = false,
  40.     autoCompleteEnable = true,
  41.     allAutoCompleteChoices = {"Lorem", "Love", "Lollipop", "ipsum", "dolor", "sit", "amet"}
  42. }
  43.  
  44. local txb2 = Textbox:new {
  45.     name = "txb2",
  46.     parent = buffer2,
  47.     buffer = buffer2,
  48.     width = buffer2.width,
  49.     height = buffer2.height,
  50.     padding = 1,
  51.     text = paragraph1,
  52.     backgroundColor = colors.black,
  53.     textColor = colors.white,
  54.     horizontalAlignment = align.left,
  55.     verticalAlignment = align.top,
  56.     wrapText = false,
  57. }
  58.  
  59.  
  60. while true do
  61.     buffer1:draw()
  62.     buffer2:draw()
  63.  
  64.     parallel.waitForAny(handleInputEvents)
  65. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement