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

Showing centered and sized text from a computer on a monitor

Started by Zeeg, 04 July 2013 - 05:38 PM
Zeeg #1
Posted 04 July 2013 - 07:38 PM
Hello, I have a little question about monitors : )

I read like ten topics about centering text on monitors and re-sizing it, every code worked to center the text, but the command "monitor.setTextScale(2)" keeps returning me "attempt to index ? (a nil value)". This is driving me crazy, I tried a lot of things, and none ever worked correctly, can someone help me please?

Here is my latest try:


monitorSide = "back"
monitor = peripheral.wrap(monitorSide)
mX, mY = monitor.getSize()
function monWriteCen(text, y)
	monitor.setCursorPos((#text-mX)/2, y)
	monitor.write(text)
end
monitor.setTextScale(2)
monWriteCen("Test", 2)

This code doesn't returns me a "attempt to index ? (a nil value)", this is even worse, the monitor is just a black screen.

Thanks for your help!
Lyqyd #2
Posted 05 July 2013 - 07:58 PM
Split into new topic.