deploy: a422bfe3f1
This commit is contained in:
@@ -63,12 +63,12 @@ Destroys the element and cleans up all references
|
|||||||
element:destroy()
|
element:destroy()
|
||||||
```
|
```
|
||||||
|
|
||||||
## BaseElement:dispatchEvent(event)
|
## BaseElement:dispatchEvent(event...)
|
||||||
Handles all events
|
Handles all events
|
||||||
@vararg any The arguments for the event
|
|
||||||
|
|
||||||
### Parameters
|
### Parameters
|
||||||
* `event` `string` The event to handle
|
* `event` `string` The event to handle
|
||||||
|
* `...` *(vararg)* `any` The arguments for the event
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
* `boolean?` `handled` Whether the event was handled
|
* `boolean?` `handled` Whether the event was handled
|
||||||
@@ -94,12 +94,12 @@ Returns the base frame of the element
|
|||||||
### Returns
|
### Returns
|
||||||
* `table` `BaseFrame` The base frame of the element
|
* `table` `BaseFrame` The base frame of the element
|
||||||
|
|
||||||
## BaseElement:handleEvent(event)
|
## BaseElement:handleEvent(event...)
|
||||||
The default event handler for all events
|
The default event handler for all events
|
||||||
@vararg any The arguments for the event
|
|
||||||
|
|
||||||
### Parameters
|
### Parameters
|
||||||
* `event` `string` The event to handle
|
* `event` `string` The event to handle
|
||||||
|
* `...` *(vararg)* `any` The arguments for the event
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
* `boolean?` `handled` Whether the event was handled
|
* `boolean?` `handled` Whether the event was handled
|
||||||
|
|||||||
@@ -96,12 +96,12 @@ Removes a child from the container
|
|||||||
### Returns
|
### Returns
|
||||||
* `Container?` `self` The container instance
|
* `Container?` `self` The container instance
|
||||||
|
|
||||||
## Container:handleEvent(event)
|
## Container:handleEvent(event...)
|
||||||
Default handler for events
|
Default handler for events
|
||||||
@vararg any The event arguments
|
|
||||||
|
|
||||||
### Parameters
|
### Parameters
|
||||||
* `event` `string` The event to handle
|
* `event` `string` The event to handle
|
||||||
|
* `...` *(vararg)* `any` The event arguments
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
* `boolean` `Whether` the event was handled
|
* `boolean` `Whether` the event was handled
|
||||||
|
|||||||
@@ -4,28 +4,67 @@
|
|||||||
|
|
||||||
|Field|Type|Description|
|
|Field|Type|Description|
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
|
|_logs|`table`|The complete log history|
|
||||||
|
|_enabled|`boolean`|If the logger is enabled|
|
||||||
|
|_logToFile|`boolean`|If the logger should log to a file|
|
||||||
|
|_logFile|`string`|The file to log to|
|
||||||
|
|LEVEL|`table`|The log levels|
|
||||||
|
|
||||||
## Functions
|
## Functions
|
||||||
|
|
||||||
|Method|Returns|Description|
|
|Method|Returns|Description|
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
|[Log.error](#Log.error)|-|
|
|[Log.debug](#Log.debug)|-|Sends a debug message
|
||||||
|[Log.setEnabled](#Log.setEnabled)|-|
|
|[Log.error](#Log.error)|-|Sends an error message
|
||||||
|[Log.setLogToFile](#Log.setLogToFile)|-|
|
|[Log.info](#Log.info)|-|Sends an info message
|
||||||
|
|[Log.setEnabled](#Log.setEnabled)|-|Sets if the logger should log
|
||||||
|
|[Log.setLogToFile](#Log.setLogToFile)|-|Sets if the logger should log to a file
|
||||||
|
|[Log.warn](#Log.warn)|-|Sends a warning message
|
||||||
|
|
||||||
## Log.error()
|
## Log.debug()
|
||||||
Sends a debug message to the logger.
|
Sends a debug message to the logger.
|
||||||
@vararg string The message to log
|
|
||||||
Sends an info message to the logger.
|
### Usage
|
||||||
@vararg string The message to log
|
```lua
|
||||||
Sends a warning message to the logger.
|
Log.debug("This is a debug message")
|
||||||
@vararg string The message to log
|
```
|
||||||
|
|
||||||
|
## Log.error(...)
|
||||||
Sends an error message to the logger.
|
Sends an error message to the logger.
|
||||||
@vararg string The message to log
|
|
||||||
|
### Parameters
|
||||||
|
* `...` *(vararg)* `string` The message to log
|
||||||
|
|
||||||
|
### Usage
|
||||||
|
```lua
|
||||||
|
Log.error("This is an error message")
|
||||||
|
```
|
||||||
|
|
||||||
|
## Log.info(...)
|
||||||
|
Sends an info message to the logger.
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
* `...` *(vararg)* `string` The message to log
|
||||||
|
|
||||||
|
### Usage
|
||||||
|
```lua
|
||||||
|
Log.info("This is an info message")
|
||||||
|
```
|
||||||
|
|
||||||
## Log.setEnabled()
|
## Log.setEnabled()
|
||||||
sets if the logger should log
|
Sets if the logger should log
|
||||||
|
|
||||||
## Log.setLogToFile()
|
## Log.setLogToFile()
|
||||||
Sets if the logger should log to a file.
|
Sets if the logger should log to a file.
|
||||||
|
|
||||||
|
## Log.warn(...)
|
||||||
|
Sends a warning message to the logger.
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
* `...` *(vararg)* `string` The message to log
|
||||||
|
|
||||||
|
### Usage
|
||||||
|
```lua
|
||||||
|
Log.warn("This is a warning message")
|
||||||
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,34 +1,197 @@
|
|||||||
## Render.new()
|
# Render
|
||||||
|
|
||||||
## Render:addDirtyRect()
|
## Fields
|
||||||
|
|
||||||
## Render:bg()
|
|Field|Type|Description|
|
||||||
|
|---|---|---|
|
||||||
|
|terminal|`table`|The terminal object to render to|
|
||||||
|
|width|`number`|The width of the render|
|
||||||
|
|height|`number`|The height of the render|
|
||||||
|
|buffer|`table`|The buffer to render|
|
||||||
|
|xCursor|`number`|The x position of the cursor|
|
||||||
|
|yCursor|`number`|The y position of the cursor|
|
||||||
|
|blink|`boolean`|Whether the cursor should blink|
|
||||||
|
|
||||||
## Render:blit()
|
## Functions
|
||||||
|
|
||||||
## Render:blit()
|
|Method|Returns|Description|
|
||||||
|
|---|---|---|
|
||||||
|
|[Render.new](#Render.new)|Render|
|
||||||
|
|[Render:addDirtyRect](#Render:addDirtyRect)|s|
|
||||||
|
|[Render:bg](#Render:bg)|s|
|
||||||
|
|[Render:blit](#Render:blit)|s|
|
||||||
|
|[Render:clear](#Render:clear)|s|
|
||||||
|
|[Render:clearArea](#Render:clearArea)|-|
|
||||||
|
|[Render:fg](#Render:fg)|s|
|
||||||
|
|[Render:getSize](#Render:getSize)|s|
|
||||||
|
|[Render:mergeRects](#Render:mergeRects)|s|
|
||||||
|
|[Render:multiBlit](#Render:multiBlit)|s|
|
||||||
|
|[Render:rectOverlaps](#Render:rectOverlaps)|s|
|
||||||
|
|[Render:render](#Render:render)|s|
|
||||||
|
|[Render:setCursor](#Render:setCursor)|-|
|
||||||
|
|[Render:text](#Render:text)|s|
|
||||||
|
|[Render:textBg](#Render:textBg)|s|
|
||||||
|
|[Render:textFg](#Render:textFg)|-|
|
||||||
|
|
||||||
## Render:clear()
|
## Render.new(terminal)
|
||||||
|
Creates a new Render object
|
||||||
|
|
||||||
## Render:clearArea()
|
### Parameters
|
||||||
|
* `terminal` `table` The terminal object to render to
|
||||||
|
|
||||||
## Render:fg()
|
### Returns
|
||||||
|
* `nil` `nil` nil
|
||||||
|
|
||||||
|
## Render:addDirtyRect(x, y, width, height)
|
||||||
|
Adds a dirty rectangle to the buffer
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
* `x` `number` The x position of the rectangle
|
||||||
|
* `y` `number` The y position of the rectangle
|
||||||
|
* `width` `number` The width of the rectangle
|
||||||
|
* `height` `number` The height of the rectangle
|
||||||
|
|
||||||
|
### Returns
|
||||||
|
* `nil` `nil` nil
|
||||||
|
|
||||||
|
## Render:bg(x, y, bg)
|
||||||
|
Blits a background color to the screen
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
* `x` `number` The x position
|
||||||
|
* `y` `number` The y position
|
||||||
|
* `bg` `string` The background color to blit
|
||||||
|
|
||||||
|
### Returns
|
||||||
|
* `nil` `nil` nil
|
||||||
|
|
||||||
|
## Render:blit(x, y, text, fg, bg)
|
||||||
|
Blits text to the screen
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
* `x` `number` The x position to blit to
|
||||||
|
* `y` `number` The y position to blit to
|
||||||
|
* `text` `string` The text to blit
|
||||||
|
* `fg` `string` The foreground color of the text
|
||||||
|
* `bg` `string` The background color of the text
|
||||||
|
|
||||||
|
### Returns
|
||||||
|
* `nil` `nil` nil
|
||||||
|
|
||||||
|
## Render:clear(bg)
|
||||||
|
Clears the screen
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
* `bg` `colors` The background color to clear the screen with
|
||||||
|
|
||||||
|
### Returns
|
||||||
|
* `nil` `nil` nil
|
||||||
|
|
||||||
|
## Render:clearArea(x, y, width, height, bg)
|
||||||
|
Clears an area of the screen
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
* `x` `number` The x position of the area
|
||||||
|
* `y` `number` The y position of the area
|
||||||
|
* `width` `number` The width of the area
|
||||||
|
* `height` `number` The height of the area
|
||||||
|
* `bg` `colors` The background color to clear the area with
|
||||||
|
|
||||||
|
## Render:fg(x, y, fg)
|
||||||
|
Blits a foreground color to the screen
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
* `x` `number` The x position
|
||||||
|
* `y` `number` The y position
|
||||||
|
* `fg` `string` The foreground color to blit
|
||||||
|
|
||||||
|
### Returns
|
||||||
|
* `nil` `nil` nil
|
||||||
|
|
||||||
## Render:getSize()
|
## Render:getSize()
|
||||||
|
Gets the size of the render
|
||||||
|
|
||||||
## Render:mergeRects()
|
### Returns
|
||||||
|
* `s` `number,` number
|
||||||
|
|
||||||
## Render:multiBlit()
|
## Render:mergeRects(target, source)
|
||||||
|
Merges two rectangles
|
||||||
|
|
||||||
## Render:rectOverlaps()
|
### Parameters
|
||||||
|
* `target` `table` The target rectangle
|
||||||
|
* `source` `table` The source rectangle
|
||||||
|
|
||||||
|
### Returns
|
||||||
|
* `nil` `nil` nil
|
||||||
|
|
||||||
|
## Render:multiBlit(x, y, width, height, text, fg, bg)
|
||||||
|
Blits text to the screen with multiple lines
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
* `x` `number` The x position to blit to
|
||||||
|
* `y` `number` The y position to blit to
|
||||||
|
* `width` `number` The width of the text
|
||||||
|
* `height` `number` The height of the text
|
||||||
|
* `text` `string` The text to blit
|
||||||
|
* `fg` `colors` The foreground color of the text
|
||||||
|
* `bg` `colors` The background color of the text
|
||||||
|
|
||||||
|
### Returns
|
||||||
|
* `nil` `nil` nil
|
||||||
|
|
||||||
|
## Render:rectOverlaps(r1, r2)
|
||||||
|
Checks if two rectangles overlap
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
* `r1` `table` The first rectangle
|
||||||
|
* `r2` `table` The second rectangle
|
||||||
|
|
||||||
|
### Returns
|
||||||
|
* `nil` `nil` nil
|
||||||
|
|
||||||
## Render:render()
|
## Render:render()
|
||||||
|
Renders the buffer to the screen
|
||||||
|
|
||||||
## Render:setCursor()
|
### Returns
|
||||||
|
* `nil` `nil` nil
|
||||||
|
|
||||||
## Render:text()
|
## Render:setCursor(x, y, blink)
|
||||||
|
Sets the cursor position
|
||||||
|
|
||||||
## Render:textBg()
|
### Parameters
|
||||||
|
* `x` `number` The x position of the cursor
|
||||||
|
* `y` `number` The y position of the cursor
|
||||||
|
* `blink` `boolean` Whether the cursor should blink
|
||||||
|
|
||||||
## Render:textFg()
|
## Render:text(x, y, text)
|
||||||
|
Blits text to the screen
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
* `x` `number` The x position to blit to
|
||||||
|
* `y` `number` The y position to blit to
|
||||||
|
* `text` `string` The text to blit
|
||||||
|
|
||||||
|
### Returns
|
||||||
|
* `nil` `nil` nil
|
||||||
|
|
||||||
|
## Render:textBg(x, y, text, bg)
|
||||||
|
Blits text to the screen with a background color
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
* `x` `number` The x position to blit to
|
||||||
|
* `y` `number` The y position to blit to
|
||||||
|
* `text` `string` The text to blit
|
||||||
|
* `bg` `colors` The background color of the text
|
||||||
|
|
||||||
|
### Returns
|
||||||
|
* `nil` `nil` nil
|
||||||
|
|
||||||
|
## Render:textFg(x, y, text, fg)
|
||||||
|
Blits text to the screen with a foreground color
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
* `x` `number` The x position to blit to
|
||||||
|
* `y` `number` The y position to blit to
|
||||||
|
* `text` `string` The text to blit
|
||||||
|
* `fg` `colors` The foreground color of the text
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user