Source Block¶
This peripheral is provided by the Source Block. It is used to display data on Create Display Targets.
The peripheral acts similar to a normal Terminal with some implementations from the Window API. It does not support formatted text.
Metadata¶
Peripheral | v1.1 |
Attach name | "create_source" |
Attach side | all |
Events¶
The RedRouter can send the following event:
Name | Description | Parameter 1 |
---|---|---|
"monitor_resize" | Whenever the display targets size changes. | string : attached_name |
Functions¶
setCursorPos(x, y)
¶
Sets the position of the cursor. write
will begin at this position.
Parameters
write(text)
¶
Will write the given input to the linked display.
Parameters
text
: string The string to write at the current cursor position.
scroll(y)
¶
Scrolls the content of the display vertically for y
lines.
Parameters
y
: number How many lines the display will scroll.
clear()
¶
Clears the whole screen.
clearLine()
¶
Clears the line at the current cursor position.
getLine(y)
¶
Returns the line at the wanted display position.
Parameters
y
: number They
position on the display.
Returns
- string The line of the given position.
Throws
- Whenever the given number is not in the range of
1
to<terminal height>
.
getCursorPos()
¶
Returns the current cursor position.
Returns
number
Thex
position of the cursor.number
They
position of the cursor.
getSize()
¶
Returns the current display size.
Returns
number
The width of the Create Display Target.number
The height of the Create Display Target.