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:
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!
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!