Jump to content




setTextScale is bugged?


  • You cannot reply to this topic
4 replies to this topic

#1 joris0127

  • New Members
  • 1 posts

Posted 21 June 2016 - 09: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

#2 The_Cat

  • Members
  • 119 posts

Posted 21 June 2016 - 10: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?

#3 Dog

  • Members
  • 1,179 posts
  • LocationEarth orbit

Posted 21 June 2016 - 10: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.

#4 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 22 June 2016 - 12:09 AM

View PostDog, on 21 June 2016 - 10:35 PM, said:

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.

#5 Dog

  • Members
  • 1,179 posts
  • LocationEarth orbit

Posted 22 June 2016 - 12:58 AM

View PostBomb Bloke, on 22 June 2016 - 12:09 AM, said:

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





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users