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

center on a 1,5 monitor question

Started by ninjastricken, 25 March 2013 - 03:41 AM
ninjastricken #1
Posted 25 March 2013 - 04:41 AM
How do i center this on a monitor that's 1,5 I'm using

http://pastebin.com/Yztn8SyN
SuicidalSTDz #2
Posted 25 March 2013 - 05:03 AM
EDIT: Just saw you redirected the terminal. It should be working… Are you specifying a side for it to wrap?

local side = "top"
local mon = term.redirect(peripheral.wrap(side))
print("Lol, wut?")
Ouput on mon: Lol, wut?
ninjastricken #3
Posted 25 March 2013 - 05:56 AM
yes i am
theoriginalbit #4
Posted 25 March 2013 - 06:07 AM
Have you changed the variables in there that are required? because it should be working perfectly fine…

also just a slight improvement change line 7 to this… it will mean that visually no matter the string it will print what looks like the middle (even length strings don't look centred if you don't do it this way)

term.setCursorPos( (w / 2) - #text / 2 + (#text % 2 == 0 and 0 or 1), y)