This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
dexter9's profile picture

How do i make a graphical display?

Started by dexter9, 20 April 2013 - 04:59 AM
dexter9 #1
Posted 20 April 2013 - 06:59 AM
Using any computer (advanced or normal) preferrably normal. I mean like putting (-) around the edges and using key arrows to select an option?
Thanks in advance
Bubba #2
Posted 20 April 2013 - 07:29 AM
I've made a menu tutorial that you can check out on Youtube (Check my sig).

As for the border, that's fairly easy:

local termX, termY = term.getSize() --Get the size of the terminal
for i=1, termY do --Use a for loop to visit each pixel on the y axis
  term.setCursorPos(1,i)
  if i==1 or i==termY then --If we're at the top or bottom of the screen
    term.write(string.rep("-", termX)) --Write "-" repeated all the way across
  else --Otherwise
    term.write("|"..string.rep(" ", termX-2).."|") --Just use a "|" character
  end
end