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

Editing message Font Size

Started by Irish286, 06 July 2012 - 04:39 AM
Irish286 #1
Posted 06 July 2012 - 06:39 AM
I'm trying to make a large sign on my server and I can't figure out how to edit font size and get it to display. I'd post my abysmal attempts but none of them are even close… I think. :P/>/> Can some one give me an example of what this coding should look like?
cant_delete_account #2
Posted 06 July 2012 - 06:42 AM
Here's some example code:
local m = peripheral.wrap(sideofmonitor)
m.setTextScale(fontsize) – fontsize is 1 through 5
Irish286 #3
Posted 06 July 2012 - 06:51 AM
Ok here's what I got:


write ("message")

local m = peripheral.wrap(sideofmonitor)
m.setTextScale(fontsize)

am I close?
MysticT #4
Posted 06 July 2012 - 05:42 PM
Here's a more complete example:

local monitorSide = "<side>" -- the side the monitor is on
local textScale = 3 -- the text scale

-- check if the monitor is present
if peripheral.isPresent(monitorSide) and peripheral.getType(monitorSide) == "monitor" then
  local mon = peripheral.wrap(monitorSide) -- get the monitor
  mon.setTextScale(textScale) -- set the text scale
  term.redirect(mon) -- redirect output to the monitor
else
  -- monitor not found, exit
  print("Monitor not found")
  return
end

-- your code here

term.restore() -- restore output to the terminal