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

setTextScale is bugged?

Started by joris0127, 21 June 2016 - 08:16 PM
joris0127 #1
Posted 21 June 2016 - 10:16 PM
Im trying to make a simple notifier system for my base. at the moment i just get a redstone input on the bottom and then send the message to a 2x3 monitor. but when i try to change the text scales from 1 everywhere to certain numbers it wont type the string "message"


local Monitor = peripheral.wrap("monitor_0")

term.clear()
term.setCursorPos(1,1)
term.write("starting \"alert\"")

function writeLine(string)
  Monitor.write(string)
  x,y = Monitor.getCursorPos()
  Monitor.setCursorPos(1,y + 1)
end

if redstone.getInput("bottom") == true then
  Monitor.clear()
  Monitor.setCursorPos(1,1)
  Monitor.setTextColor(colors.yellow)
  Monitor.setTextScale(1.5)
  writeLine("Messages:")
  Monitor.setTextColor(colors.white)
  Monitor.setTextScale(1)
  writeLine("second line?")
end
sleep(2)

when i execute this it will not write this: http://imgur.com/PbILpI0
The_Cat #2
Posted 21 June 2016 - 11:20 PM
It seems to be when you change the textScale back to 1 it only wants to write things out in that scale size. I'm not sure why, I guess you can't have different scale text sizes for a single monitor?
Dog #3
Posted 21 June 2016 - 11:35 PM
The_Cat is correct - you can only have one textScale per monitor/array. Another thing I noticed is that you're setting the cursor position before you're setting the scale. IIRC that can lead to weird results. Also, I believe the valid text scales are 0.5, 1, 2, 3, 4, 5. I don't think 1.5, 2.5, etc. are valid textScales, although I could be mistaken.
Bomb Bloke #4
Posted 22 June 2016 - 01:09 AM
I don't think 1.5, 2.5, etc. are valid textScales, although I could be mistaken.

They are; you may use 0.5 through to 5, in 0.5 increments. You're otherwise on the money.
Dog #5
Posted 22 June 2016 - 01:58 AM
They are; you may use 0.5 through to 5, in 0.5 increments. You're otherwise on the money.

Don't know why I never tried that. Shame on me for not being curious enough. Thanks :)/>