1.4 KiB
1.4 KiB
Display
The Display is a special element where you can use the window (term) API to draw on the display, useful when you need to use external APIs.
Extends: VisualElement
Functions
| Method | Returns | Description |
|---|---|---|
| Display.new | table | Creates a new Display instance |
| Display:Display | - | Initializes the Display instance |
| Display:Display | table | Returns the current window object |
| Display:Display | Display | Writes text to the display |
| Display:Display | - | Renders the Display |
Display.new()
Returns
tableselfThe created instance
Display:Display(props, basalt)
Parameters
propstableThe properties to initialize the element withbasalttableThe basalt instance
Display:Display()
Returns the current window object
Returns
tablewindowThe current window object
Display:Display(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