Difference between revisions of "Monitor"
m (Added peripheral api notice and put in the peripheral api category.) |
(Undo revision 6212 by Awsmazinggenius (talk)) |
||
Line 1: | Line 1: | ||
− | |||
{{Block | {{Block | ||
|name=Monitor | |name=Monitor | ||
Line 35: | Line 34: | ||
{{BlocksItemsList}} | {{BlocksItemsList}} | ||
− | [[Category:Blocks]][[Category:Peripherals | + | [[Category:Blocks]][[Category:Peripherals]] |
Revision as of 21:29, 26 March 2014
Monitor | |
Item ID | 4094 |
Damage Value | 0 |
Peripheral? | Yes- Term (API) |
The Monitor is a block that can display text on its front side. When several screen blocks are placed on the same plane, it will form a single monitor. The maximum size of a single monitor is 8 blocks wide and 6 blocks tall, and must be placed to be shaped as a rectangle, else it will separate into multiple parts. It is useful for displaying information at a server spawn, showing a program on the monitor, and even showing the status of an IC2 reactor! (provided you have OpenCCSensors installed)
Recipe
Redirecting Programs to a Monitor
From the CraftOS shell, type monitor [top|bottom|left|right|front|back] [a-program-name]. For example, typing monitor top hello would show "Hello world." on the top Monitor.
Monitor as a Peripheral
To use a Monitor, you need to either call a method directly using peripheral.call(), or, wrap the monitor using the Peripheral API. Wrapped monitors provide all functions listed in the Term API, with the exception of monitor.setTextScale(size), which is native to monitors only.
For this example, we have a Monitor connected to the top of our Computer:
-- Immediately invoke a method without wrapping peripheral.call("top", "write", "Hello World!")
-- You can also "wrap" the peripheral side to a variable: local monitor = peripheral.wrap("top") monitor.write("Hello World!")