Posted 11 March 2013 - 07:07 AM
So, I was tinkering with a larger project, then started running into situations where if I changed setTextScale to 0.5, it wouldn't output anything at all. Here's the program in /rom/programs/wallpaper:
When I run "wallpaper" (with a text file), it outputs just fine. In that same computer, the startup contains only:
Nothing outputs. If I comment out the setTextScale from wallpaper, startup prints the text file to the monitor (in this case, 6x6 monitors) just fine.
With the setTextScale, it also works just fine from any monitors set that's 2x2, 3x3, 4x4, but as soon as I hit 5x5 or 6x6 (my target), it does not work.
local tArgs = { ... }
local monitorSide = ""
if (tArgs[1] ~= nil) then
monitorSide = tArgs[1]
else
monitorSide = "front"
end
local mon = peripheral.wrap(monitorSide)
mon.clear()
mon.setCursorPos(1,1)
mon.setTextScale(0.5)
local lineno = 1
if fs.exists("wallpaper.txt") then
local f = fs.open("wallpaper.txt","r")
local t = f.readLine()
while t ~= nil do
mon.write(t)
mon.setCursorPos(1,lineno)
lineno = lineno + 1
t = f.readLine()
end
f.close()
else
mon.write("No wallpaper.txt found.")
end
When I run "wallpaper" (with a text file), it outputs just fine. In that same computer, the startup contains only:
shell.run("wallpaper")
Nothing outputs. If I comment out the setTextScale from wallpaper, startup prints the text file to the monitor (in this case, 6x6 monitors) just fine.
With the setTextScale, it also works just fine from any monitors set that's 2x2, 3x3, 4x4, but as soon as I hit 5x5 or 6x6 (my target), it does not work.