1.1 KiB
1.1 KiB
Display : VisualElement
The Display is a special element where you can use the window (term) API to draw on a element, useful when you need to use external APIs.
Functions
| Method | Returns | Description |
|---|---|---|
| Display:getWindow | table | Returns the current window object |
| Display:write | Display | Writes text to the display |
Protected Functions
| Method | Returns | Description |
|---|---|---|
| Display:init | - | Initializes the Display instance |
| Display:render | - | Renders the Display |
Display:getWindow()
Returns the current window object
Returns
tablewindowThe current window object
Display:write(x, y, text, fg?, bg?)
Writes text to the display at the given position with the given foreground and background colors
Parameters
xnumberThe x position to write toynumberThe y position to write totextstringThe text to writefg(optional)colorsThe foreground color (optional)bg(optional)colorsThe background color (optional)
Returns
DisplayselfThe display instance