Monitor API

From ComputerCraft
Jump to: navigation, search
FunctionFunctionmonitor.getTextScale
Returns the value of a monitor peripheral's text scale as set by it's setTextScale command, defaulting to 1 if the function was never invoked.
Syntax monitor.getTextScale()
Returns number
Part of CC:Tweaked
API Monitor
ExampleExampleScale value retrieval
Gets a monitors text scale, changes it, then get's it again
Code
local mon = peripheral.find("monitor")
print(mon.getTextScale())
mon.setTextScale(5)
print(mon.getTextScale())


FunctionFunctionmonitor.setTextScale
Sets a monitor peripheral's text scale. It must be a multiple of 0.5 between 0.5 and 5. The default value is 1.
Syntax monitor.setTextScale(
  • scale : number The scale to use for drawing text, 0.5 being the smallest and 5 being the biggest.
)
Returns nil
Part of CC:Tweaked
API Monitor
ExampleExampleScale value retrieval
Sets a text scale to display smaller text
Code
local mon = peripheral.find("monitor")
mon.setTextScale(0.5)
mon.write("Hello, World!")