3.2 KiB
3.2 KiB
BaseFrame : Container
This is the base frame class. It is the root element of all elements and the only element without a parent.
Fields
| Field | Type | Description |
|---|---|---|
| _render | Render |
The render object |
| _renderUpdate | boolean |
Whether the render object needs to be updated |
Properties
| Property | Type | Default | Description |
|---|---|---|---|
| text | term | nil | The terminal object to render to |
Functions
| Method | Returns | Description |
|---|---|---|
| BaseFrame.new | BaseFrame | Creates a new Frame instance |
| BaseFrame:blit | - | Renders a text with a foreground and background color to the render Object |
| BaseFrame:init | table | Initializes the Frame instance |
| BaseFrame:mouse_up | - | |
| BaseFrame:multiBlit | - | Renders a multiBlit to the render Object |
| BaseFrame:render | - | Renders the Frame |
| BaseFrame:setCursor | - | Sets the cursor position |
| BaseFrame:term_resize | - | |
| BaseFrame:textBg | - | Renders a text with a background color to the render Object |
| BaseFrame:textFg | - | Renders a text with a foreground color to the render Object |
BaseFrame.new()
Creates a new Frame instance
Returns
BaseFrameobjectThe newly created Frame instance
Usage
local element = BaseFrame.new()
BaseFrame:blit(x, y, text, fg, bg)
Renders a text with a foreground and background color to the render Object
Parameters
xnumberThe x position to render toynumberThe y position to render totextstringThe text to renderfgstringThe foreground colorbgstringThe background color
BaseFrame:init(props, basalt)
Initializes the Frame instance
Parameters
propstableThe properties to initialize the element withbasalttableThe basalt instance
Returns
tableselfThe initialized instance
BaseFrame:mouse_up()
BaseFrame:multiBlit(x, y, width, height, text, fg, bg)
Renders a multiBlit to the render Object
Parameters
xnumberThe x position to render toynumberThe y position to render towidthnumberThe width of the textheightnumberThe height of the texttextstringThe text to renderfgstringThe foreground colorbgstringThe background color
BaseFrame:render()
Renders the Frame
BaseFrame:setCursor(x, y, blink)
Sets the cursor position
Parameters
xnumberThe x position to set the cursor toynumberThe y position to set the cursor toblinkbooleanWhether the cursor should blink
BaseFrame:term_resize()
BaseFrame:textBg(x, y, text, bg)
Renders a text with a background color to the render Object
Parameters
xnumberThe x position to render toynumberThe y position to render totextstringThe text to renderbgcolorsThe background color
BaseFrame:textFg(x, y, text, fg)
Renders a text with a foreground color to the render Object
Parameters
xnumberThe x position to render toynumberThe y position to render totextstringThe text to renderfgcolorsThe foreground color