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

Monitor Text

Started by iLoveLoosy12, 28 October 2012 - 05:08 AM
iLoveLoosy12 #1
Posted 28 October 2012 - 06:08 AM
I just need a few basics about monitor text formatting.

I'd like to create a small 2x2 monitor as a directory in a mall setup that I have on the server I play on.

I'd like it to say:

(Centered) Directory
()
(Two columns)
[name1] [name2]
[name3] [name4]
[name5] [name6]
[name7] [name8]
[name9] [name10]

Adjusting for whatever font necessary to make it work
MathManiac #2
Posted 10 November 2012 - 05:01 PM
Please move this thread to the Ask a Pro forum topic, located here: http://www.computercraft.info/forums2/index.php?/forum/14-ask-a-pro/ To move this thread to that topic, please report your forum thread and say that it is in the wrong topic, and should be located to the Ask a Pro forum section.
anonimo182 #3
Posted 11 November 2012 - 01:15 PM
You want it like:
Directory
1 5
2 6
3 7
4 8
?

You could use:

side = "side of the monitor here"
dir = "Directory"
part = {"part1", "part2", "part3", ...}

mon = peripheral.wrap(side)
w, h = mon.getSize()
mon.setCursorPos(w/2 - #dir, 1)
mon.write(dir)
mon.setCursorPos(1, h-10)
mon.write(textutils.tabulate(part))
Cruor #4
Posted 12 November 2012 - 12:16 AM
Please move this thread to the Ask a Pro forum topic, located here: http://www.computerc...m/14-ask-a-pro/ To move this thread to that topic, please report your forum thread and say that it is in the wrong topic, and should be located to the Ask a Pro forum section.
.-. damn i like you.
*poof* Moved.
Doyle3694 #5
Posted 12 November 2012 - 12:51 AM
I would do something like:

function centerText(text, y)
   x = term.getSize()-#text/2
   term.setCursorPos(x,y)
   write(text)
end

for centered print.