Jump to content




How to set the scale of text on a monitor


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

#1 ElectricOverride

  • Members
  • 94 posts

Posted 28 September 2012 - 07:20 PM

Okay, so lets get started.

first you need to define a peripheral with
p = peripheral.wrap("side")

replace side with whatever side the monitor is on the computer and replace p with whatever you want!

now we shall set the text scale.

p.setTextScale(Text Size)

now replace p with what you replaced p with before and text size, well, you guessed it, how big or small you want to make the text.

Note:The lowest text scale is 1, default and the highest is 5.

Now you can print with print("")

Finally just save, exit and run the program on the monitor,
and if you did this correctly, you should get 0 errors and your text should be the right size.

Happy printing!

#2 MysticT

    Lua Wizard

  • Members
  • 1,597 posts

Posted 28 September 2012 - 07:31 PM

I think you missed some steps.
local mon = peripheral.wrap("side") -- get the monitor. side is the side of the monitor
mon.setTextScale(size) -- set the text size. size must be a number between 0.5 and 5 in increments of 0.5
term.redirect(mon) -- redirect output to the monitor
-- now you can print to the monitor
print("Text on the Monitor!")
term.restore() -- restore the output to the console


#3 Cranium

    Ninja Scripter

  • Moderators
  • 4,031 posts
  • LocationLincoln, Nebraska

Posted 28 September 2012 - 07:34 PM

Or to put it on the monitor without redirecting:
p.write("Text on the monitor!")


#4 ElectricOverride

  • Members
  • 94 posts

Posted 07 October 2012 - 02:43 PM

View PostMysticT, on 28 September 2012 - 07:31 PM, said:

I think you missed some steps.
local mon = peripheral.wrap("side") -- get the monitor. side is the side of the monitor
mon.setTextScale(size) -- set the text size. size must be a number between 0.5 and 5 in increments of 0.5
term.redirect(mon) -- redirect output to the monitor
-- now you can print to the monitor
print("Text on the Monitor!")
term.restore() -- restore the output to the console
hmm, my tutorial is on what i do and it works . dunno.

#5 MysticT

    Lua Wizard

  • Members
  • 1,597 posts

Posted 07 October 2012 - 03:28 PM

View PostElectricOverride, on 07 October 2012 - 02:43 PM, said:

View PostMysticT, on 28 September 2012 - 07:31 PM, said:

I think you missed some steps.
local mon = peripheral.wrap("side") -- get the monitor. side is the side of the monitor
mon.setTextScale(size) -- set the text size. size must be a number between 0.5 and 5 in increments of 0.5
term.redirect(mon) -- redirect output to the monitor
-- now you can print to the monitor
print("Text on the Monitor!")
term.restore() -- restore the output to the console
hmm, my tutorial is on what i do and it works . dunno.
Yes, but I meant that you can't use print without redirecting, and you didn't say that.

#6 ElectricOverride

  • Members
  • 94 posts

Posted 06 November 2012 - 08:49 AM

View PostMysticT, on 07 October 2012 - 03:28 PM, said:

View PostElectricOverride, on 07 October 2012 - 02:43 PM, said:

View PostMysticT, on 28 September 2012 - 07:31 PM, said:

I think you missed some steps.
local mon = peripheral.wrap("side") -- get the monitor. side is the side of the monitor
mon.setTextScale(size) -- set the text size. size must be a number between 0.5 and 5 in increments of 0.5
term.redirect(mon) -- redirect output to the monitor
-- now you can print to the monitor
print("Text on the Monitor!")
term.restore() -- restore the output to the console
hmm, my tutorial is on what i do and it works . dunno.
Yes, but I meant that you can't use print without redirecting, and you didn't say that.
Ah, I see, okay.

#7 janmo96

  • New Members
  • 2 posts

Posted 16 February 2013 - 07:28 AM

how to set position of the text

#8 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 16 February 2013 - 07:38 AM

Try reading the wiki. You use term.setCursorPos (or replace term with a wrapped monitor table).

#9 janmo96

  • New Members
  • 2 posts

Posted 16 February 2013 - 07:49 AM

how i can do like rules info that will show all to time cause when i disconnect i cant see text what i putted on monitor

#10 MudkipTheEpic

  • Members
  • 639 posts
  • LocationWhere you'd least expect it.

Posted 17 February 2013 - 08:39 AM

Smallest font is 0.5 not 1... I think

#11 Dlcruz129

    What's a Lua?

  • Members
  • 1,423 posts

Posted 17 February 2013 - 08:47 AM

View PostMudkipTheEpic, on 17 February 2013 - 08:39 AM, said:

Smallest font is 0.5 not 1... I think

And you are correct.

#12 ElectricOverride

  • Members
  • 94 posts

Posted 07 March 2013 - 05:27 AM

View PostDlcruz129, on 17 February 2013 - 08:47 AM, said:

View PostMudkipTheEpic, on 17 February 2013 - 08:39 AM, said:

Smallest font is 0.5 not 1... I think

And you are correct.
This was before the smallest font was 0.5

#13 ElectricOverride

  • Members
  • 94 posts

Posted 07 March 2013 - 05:28 AM

View Postjanmo96, on 16 February 2013 - 07:49 AM, said:

how i can do like rules info that will show all to time cause when i disconnect i cant see text what i putted on monitor
You need to restart the computer, as all computers/turtles shutdown once a server or singleplayer client is stopped.

#14 no9name909

  • Members
  • 5 posts

Posted 13 March 2013 - 07:36 AM

Thanks for the tutorial!
Now I know what I did wrong.

#15 ElectricOverride

  • Members
  • 94 posts

Posted 18 March 2013 - 07:05 AM

View Postno9name909, on 13 March 2013 - 07:36 AM, said:

Thanks for the tutorial!
Now I know what I did wrong.
No problem.

#16 PlowmanPlow

  • Members
  • 5 posts

Posted 21 March 2013 - 06:51 AM

View PostElectroSystems™CEO/Elec, on 07 March 2013 - 05:28 AM, said:

You need to restart the computer, as all computers/turtles shutdown once a server or singleplayer client is stopped.

Remember that you can put a "startup" program on the computer which calls your program when the computer starts (i.e. when the server/SSP starts)
shell.run("myprogram")


#17 ElectricOverride

  • Members
  • 94 posts

Posted 13 July 2013 - 09:50 AM

View PostPlowmanPlow, on 21 March 2013 - 06:51 AM, said:

View PostElectroSystems™CEO/Elec, on 07 March 2013 - 05:28 AM, said:

You need to restart the computer, as all computers/turtles shutdown once a server or singleplayer client is stopped.

Remember that you can put a "startup" program on the computer which calls your program when the computer starts (i.e. when the server/SSP starts)
shell.run("myprogram")
I now know that using shell.run works, I used to allways think you needed to manually start a pc or nothing would happen, thanks!





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users