diff --git a/docs/references/elementManager.md b/docs/references/elementManager.md index e124d42..778def2 100644 --- a/docs/references/elementManager.md +++ b/docs/references/elementManager.md @@ -6,10 +6,10 @@ and then applies the plugins to the elements. It also provides a way to get elem |Method|Returns|Description| |---|---|---| -|[ElementManager.getAPI](#ElementManager.getAPI)|table| -|[ElementManager.getElement](#ElementManager.getElement)|table| -|[ElementManager.getElementList](#ElementManager.getElementList)|table| -|[ElementManager.loadElement](#ElementManager.loadElement)|-| +|[ElementManager.getAPI](#elementmanager-getapi)|table| +|[ElementManager.getElement](#elementmanager-getelement)|table| +|[ElementManager.getElementList](#elementmanager-getelementlist)|table| +|[ElementManager.loadElement](#elementmanager-loadelement)|-| ## ElementManager.getAPI(name) diff --git a/docs/references/elements/BarChart.md b/docs/references/elements/BarChart.md index 275e0a8..08d3ec1 100644 --- a/docs/references/elements/BarChart.md +++ b/docs/references/elements/BarChart.md @@ -1,17 +1,12 @@ # BarChart : Graph This is the bar chart class. It is based on the graph element. It draws bar based points. -## Functions - -|Method|Returns|Description| -|---|---|---| - ## Protected Functions |Method|Returns|Description| |---|---|---| -|[BarChart:init](#BarChart:init)|BarChart|Initializes the BarChart instance -|[BarChart:render](#BarChart:render)|-|Renders the BarChart +|BarChart:init|BarChart|Initializes the BarChart instance +|BarChart:render|-|Renders the BarChart diff --git a/docs/references/elements/BaseElement.md b/docs/references/elements/BaseElement.md index 068a618..bd67a0c 100644 --- a/docs/references/elements/BaseElement.md +++ b/docs/references/elements/BaseElement.md @@ -14,41 +14,46 @@ The base class for all UI elements in Basalt. This class provides basic properti |Method|Returns|Description| |---|---|---| -|[BaseElement.defineEvent](#BaseElement.defineEvent)|-| -|[BaseElement.registerEventCallback](#BaseElement.registerEventCallback)|-| -|[BaseElement:destroy](#BaseElement:destroy)|-|Destroys the element and cleans up all references -|[BaseElement:fireEvent](#BaseElement:fireEvent)|table|Triggers an event and calls all registered callbacks -|[BaseElement:getBaseFrame](#BaseElement:getBaseFrame)|table|Returns the base frame of the element -|[BaseElement:isType](#BaseElement:isType)|boolean|Checks if the element is a specific type -|[BaseElement:listenEvent](#BaseElement:listenEvent)|table|Enables or disables event listening for a specific event -|[BaseElement:onChange](#BaseElement:onChange)|table|Observes a property and calls a callback when it changes -|[BaseElement:registerCallback](#BaseElement:registerCallback)|table|Registers a callback function -|[BaseElement:updateRender](#BaseElement:updateRender)|-|Requests a render update for this element +|[BaseElement.defineEvent](#baseelement-defineevent)|-|Registers a new event listener for the element (on class level) +|[BaseElement.registerEventCallback](#baseelement-registereventcallback)|-|Registers a new event callback for the element (on class level) +|[BaseElement:destroy](#baseelement-destroy)|-|Destroys the element and cleans up all references +|[BaseElement:fireEvent](#baseelement-fireevent)|table|Triggers an event and calls all registered callbacks +|[BaseElement:getBaseFrame](#baseelement-getbaseframe)|BaseFrame|Returns the base frame of the element +|[BaseElement:isType](#baseelement-istype)|boolean|Checks if the element is a specific type +|[BaseElement:listenEvent](#baseelement-listenevent)|table|Enables or disables event listening for a specific event +|[BaseElement:onChange](#baseelement-onchange)|table|Observes a property and calls a callback when it changes +|[BaseElement:registerCallback](#baseelement-registercallback)|table|Registers a callback function +|[BaseElement:updateRender](#baseelement-updaterender)|table|Requests a render update for this element ## Protected Functions |Method|Returns|Description| |---|---|---| -|[BaseElement:dispatchEvent](#BaseElement:dispatchEvent)|boolean?|Handles all events -|[BaseElement:handleEvent](#BaseElement:handleEvent)|boolean?|The default event handler for all events -|[BaseElement:init](#BaseElement:init)|table|Initializes the BaseElement instance -|[BaseElement:postInit](#BaseElement:postInit)|table|Post initialization +|BaseElement:dispatchEvent|boolean?|Handles all events +|BaseElement:handleEvent|boolean?|The default event handler for all events +|BaseElement:init|table|Initializes the BaseElement instance +|BaseElement:postInit|table|Post initialization -## BaseElement.defineEvent() +## BaseElement.defineEvent(class, eventName, requiredEvent?) Registers a new event listener for the element (on class level) -## BaseElement.registerEventCallback() +### Parameters +* `class` `table` The class to register +* `eventName` `string` The name of the event to register +* `requiredEvent` *(optional)* `string` The name of the required event (optional) + +## BaseElement.registerEventCallback(class, callbackName, ...) Registers a new event callback for the element (on class level) +### Parameters +* `class` `table` The class to register +* `callbackName` `string` The name of the callback to register +* `...` `string` The names of the events to register the callback for + ## BaseElement:destroy() Destroys the element and cleans up all references -### Usage - ```lua -element:destroy() -``` - ## BaseElement:fireEvent(event, ...) Triggers an event and calls all registered callbacks @@ -59,16 +64,11 @@ Triggers an event and calls all registered callbacks ### Returns * `table` `self` The BaseElement instance -### Usage - ```lua -element:fireEvent("mouse_click", 1, 2) -``` - ## BaseElement:getBaseFrame() Returns the base frame of the element ### Returns -* `table` `BaseFrame` The base frame of the element +* `BaseFrame` `BaseFrame` The base frame of the element ## BaseElement:isType(type) Checks if the element is a specific type @@ -77,7 +77,7 @@ Checks if the element is a specific type * `type` `string` The type to check for ### Returns -* `boolean` `Whether` the element is of the specified type +* `boolean` `isType` Whether the element is of the specified type ## BaseElement:listenEvent(eventName, enable?) Enables or disables event listening for a specific event @@ -89,11 +89,6 @@ Enables or disables event listening for a specific event ### Returns * `table` `self` The BaseElement instance -### Usage - ```lua -element:listenEvent("mouse_click", true) -``` - ## BaseElement:onChange(property, callback) Observes a property and calls a callback when it changes @@ -114,17 +109,10 @@ Registers a callback function for an event ### Returns * `table` `self` The BaseElement instance -### Usage - ```lua -element:registerCallback("mouse_click", function(self, ...) end) -``` - ## BaseElement:updateRender() Requests a render update for this element -### Usage - ```lua -element:updateRender() -``` +### Returns +* `table` `self` The BaseElement instance diff --git a/docs/references/elements/BaseFrame.md b/docs/references/elements/BaseFrame.md index 7df6498..830ea85 100644 --- a/docs/references/elements/BaseFrame.md +++ b/docs/references/elements/BaseFrame.md @@ -18,24 +18,24 @@ This is the base frame class. It is the root element of all elements and the onl |Method|Returns|Description| |---|---|---| -|[BaseFrame:setCursor](#BaseFrame:setCursor)|-|Sets the cursor position +|[BaseFrame:setCursor](#baseframe-setcursor)|-|Sets the cursor position ## Protected Functions |Method|Returns|Description| |---|---|---| -|[BaseFrame:blit](#BaseFrame:blit)|-|Renders a text with a foreground and background color to the render Object -|[BaseFrame:char](#BaseFrame:char)|-|Handles character events -|[BaseFrame:init](#BaseFrame:init)|table|Initializes the Frame instance -|[BaseFrame:key](#BaseFrame:key)|-|Handles key events -|[BaseFrame:key_up](#BaseFrame:key_up)|-|Handles key up events -|[BaseFrame:mouse_up](#BaseFrame:mouse_up)|-|Handles mouse up events -|[BaseFrame:multiBlit](#BaseFrame:multiBlit)|-|Renders a multiBlit to the render Object -|[BaseFrame:render](#BaseFrame:render)|-|Renders the Frame -|[BaseFrame:term_resize](#BaseFrame:term_resize)|-|Resizes the Frame -|[BaseFrame:textBg](#BaseFrame:textBg)|-|Renders a text with a background color to the render Object -|[BaseFrame:textFg](#BaseFrame:textFg)|-|Renders a text with a foreground color to the render Object +|BaseFrame:blit|-|Renders a text with a foreground and background color to the render Object +|BaseFrame:char|-|Handles character events +|BaseFrame:init|table|Initializes the Frame instance +|BaseFrame:key|-|Handles key events +|BaseFrame:key_up|-|Handles key up events +|BaseFrame:mouse_up|-|Handles mouse up events +|BaseFrame:multiBlit|-|Renders a multiBlit to the render Object +|BaseFrame:render|-|Renders the Frame +|BaseFrame:term_resize|-|Resizes the Frame +|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:setCursor(x, y, blink) Sets the cursor position diff --git a/docs/references/elements/BigFont.md b/docs/references/elements/BigFont.md index 3efaee2..56791b4 100644 --- a/docs/references/elements/BigFont.md +++ b/docs/references/elements/BigFont.md @@ -8,17 +8,12 @@ The BigFont element is a text element that displays large text. |text|string|BigFont|BigFont text |fontSize|number|1|The font size of the BigFont -## Functions - -|Method|Returns|Description| -|---|---|---| - ## Protected Functions |Method|Returns|Description| |---|---|---| -|[BigFont:init](#BigFont:init)|-|Initializes the BigFont instance -|[BigFont:render](#BigFont:render)|-|Renders the BigFont +|BigFont:init|-|Initializes the BigFont instance +|BigFont:render|-|Renders the BigFont diff --git a/docs/references/elements/BigFont_BigFontText.md b/docs/references/elements/BigFont_BigFontText.md index 20511d2..871423e 100644 --- a/docs/references/elements/BigFont_BigFontText.md +++ b/docs/references/elements/BigFont_BigFontText.md @@ -2,10 +2,5 @@ Basalt - Nyorie: Please don't copy paste this code to your projects, this code is slightly changed (to fit the way basalt draws stuff), if you want the original code, checkout this: http://www.computercraft.info/forums2/index.php?/topic/25367-bigfont-api-write-bigger-letters-v10/ -## Functions - -|Method|Returns|Description| -|---|---|---| - diff --git a/docs/references/elements/Button.md b/docs/references/elements/Button.md index 6358e61..ad43953 100644 --- a/docs/references/elements/Button.md +++ b/docs/references/elements/Button.md @@ -7,17 +7,12 @@ The Button is a standard button element with click handling and state management |---|---|---|---| |text|string|Button|Button text -## Functions - -|Method|Returns|Description| -|---|---|---| - ## Protected Functions |Method|Returns|Description| |---|---|---| -|[Button:init](#Button:init)|-|Initializes the Button instance -|[Button:render](#Button:render)|-|Renders the Button +|Button:init|-|Initializes the Button instance +|Button:render|-|Renders the Button diff --git a/docs/references/elements/Checkbox.md b/docs/references/elements/Checkbox.md index 848cee8..82e87a1 100644 --- a/docs/references/elements/Checkbox.md +++ b/docs/references/elements/Checkbox.md @@ -10,19 +10,14 @@ The Checkbox is a visual element that can be checked. |checkedText|string|Text|when checked |autoSize|boolean|true|Whether to automatically size the checkbox -## Functions - -|Method|Returns|Description| -|---|---|---| - ## Protected Functions |Method|Returns|Description| |---|---|---| -|[Checkbox.new](#Checkbox.new)|Checkbox|Creates a new Checkbox instance -|[Checkbox:init](#Checkbox:init)|-|Initializes the Checkbox instance -|[Checkbox:mouse_click](#Checkbox:mouse_click)|boolean|Handles mouse click events -|[Checkbox:render](#Checkbox:render)|-|Renders the Checkbox +|Checkbox.new|Checkbox|Creates a new Checkbox instance +|Checkbox:init|-|Initializes the Checkbox instance +|Checkbox:mouse_click|boolean|Handles mouse click events +|Checkbox:render|-|Renders the Checkbox diff --git a/docs/references/elements/Container.md b/docs/references/elements/Container.md index 5215367..66f6352 100644 --- a/docs/references/elements/Container.md +++ b/docs/references/elements/Container.md @@ -27,40 +27,40 @@ like Frames, BaseFrames, and more. |Method|Returns|Description| |---|---|---| -|[Container:addChild](#Container:addChild)|Container|Adds a child to the container -|[Container:callChildrenEvent](#Container:callChildrenEvent)|boolean|Calls a event on all children -|[Container:clear](#Container:clear)|Container|Clears the container -|[Container:getChild](#Container:getChild)|Container?|Removes a child from the container -|[Container:isChildVisible](#Container:isChildVisible)|boolean|Returns whether a child is visible -|[Container:registerChildEvent](#Container:registerChildEvent)|Container|Registers the children events of the container -|[Container:registerChildrenEvents](#Container:registerChildrenEvents)|Container|Registers the children events of the container -|[Container:removeChild](#Container:removeChild)|Container|Removes a child from the container -|[Container:removeChildrenEvents](#Container:removeChildrenEvents)|Container|Unregisters the children events of the container -|[Container:sortChildren](#Container:sortChildren)|Container|Sorts the children of the container -|[Container:sortChildrenEvents](#Container:sortChildrenEvents)|Container|Sorts the children events of the container -|[Container:unregisterChildEvent](#Container:unregisterChildEvent)|Container|Unregisters the children events of the container +|[Container:addChild](#container-addchild)|Container|Adds a child to the container +|[Container:callChildrenEvent](#container-callchildrenevent)|boolean|Calls a event on all children +|[Container:clear](#container-clear)|Container|Clears the container +|[Container:getChild](#container-getchild)|Container?|Removes a child from the container +|[Container:isChildVisible](#container-ischildvisible)|boolean|Returns whether a child is visible +|[Container:registerChildEvent](#container-registerchildevent)|Container|Registers the children events of the container +|[Container:registerChildrenEvents](#container-registerchildrenevents)|Container|Registers the children events of the container +|[Container:removeChild](#container-removechild)|Container|Removes a child from the container +|[Container:removeChildrenEvents](#container-removechildrenevents)|Container|Unregisters the children events of the container +|[Container:sortChildren](#container-sortchildren)|Container|Sorts the children of the container +|[Container:sortChildrenEvents](#container-sortchildrenevents)|Container|Sorts the children events of the container +|[Container:unregisterChildEvent](#container-unregisterchildevent)|Container|Unregisters the children events of the container ## Protected Functions |Method|Returns|Description| |---|---|---| -|[Container:blit](#Container:blit)|Container|Draws a line of text and fg and bg as colors -|[Container:char](#Container:char)|boolean|Handles char events -|[Container:handleEvent](#Container:handleEvent)|boolean|Default handler for events -|[Container:init](#Container:init)|-|Initializes the Container instance -|[Container:key](#Container:key)|boolean|Handles key events -|[Container:key_up](#Container:key_up)|boolean|Handles key up events -|[Container:mouse_click](#Container:mouse_click)|boolean|Handles mouse click events -|[Container:mouse_drag](#Container:mouse_drag)|boolean|Handles mouse drag events -|[Container:mouse_move](#Container:mouse_move)|boolean|Handles mouse move events -|[Container:mouse_release](#Container:mouse_release)|-|Handles mouse release events -|[Container:mouse_scroll](#Container:mouse_scroll)|boolean|Handles mouse scroll events -|[Container:mouse_up](#Container:mouse_up)|boolean|Handles mouse up events -|[Container:multiBlit](#Container:multiBlit)|Container|Draws multiple lines of text, fg and bg strings -|[Container:render](#Container:render)|-|Renders the container -|[Container:textBg](#Container:textBg)|Container|Draws a line of text and bg as color -|[Container:textFg](#Container:textFg)|Container|Draws a line of text and fg as color +|Container:blit|Container|Draws a line of text and fg and bg as colors +|Container:char|boolean|Handles char events +|Container:handleEvent|boolean|Default handler for events +|Container:init|-|Initializes the Container instance +|Container:key|boolean|Handles key events +|Container:key_up|boolean|Handles key up events +|Container:mouse_click|boolean|Handles mouse click events +|Container:mouse_drag|boolean|Handles mouse drag events +|Container:mouse_move|boolean|Handles mouse move events +|Container:mouse_release|-|Handles mouse release events +|Container:mouse_scroll|boolean|Handles mouse scroll events +|Container:mouse_up|boolean|Handles mouse up events +|Container:multiBlit|Container|Draws multiple lines of text, fg and bg strings +|Container:render|-|Renders the container +|Container:textBg|Container|Draws a line of text and bg as color +|Container:textFg|Container|Draws a line of text and fg as color ## Container:addChild(child) Adds a child to the container diff --git a/docs/references/elements/Display.md b/docs/references/elements/Display.md index 3a06066..f8d2987 100644 --- a/docs/references/elements/Display.md +++ b/docs/references/elements/Display.md @@ -5,15 +5,15 @@ The Display is a special element where you can use the window (term) API to draw |Method|Returns|Description| |---|---|---| -|[Display:getWindow](#Display:getWindow)|table|Returns the current window object +|[Display:getWindow](#display-getwindow)|table|Returns the current window object ## Protected Functions |Method|Returns|Description| |---|---|---| -|[Display:init](#Display:init)|-|Initializes the Display instance -|[Display:render](#Display:render)|-|Renders the Display +|Display:init|-|Initializes the Display instance +|Display:render|-|Renders the Display ## Display:getWindow() Returns the current window object diff --git a/docs/references/elements/Dropdown.md b/docs/references/elements/Dropdown.md index 9096da9..5b1e0f3 100644 --- a/docs/references/elements/Dropdown.md +++ b/docs/references/elements/Dropdown.md @@ -10,18 +10,13 @@ This is the dropdown class. It is a visual element that can show a list of selec |selectedText|string|""|The text to show when no item is selected |dropSymbol|string|"\31"|The symbol to show for dropdown indication -## Functions - -|Method|Returns|Description| -|---|---|---| - ## Protected Functions |Method|Returns|Description| |---|---|---| -|[Dropdown:init](#Dropdown:init)|Dropdown|Initializes the Dropdown instance -|[Dropdown:mouse_click](#Dropdown:mouse_click)|boolean|Handles mouse click events -|[Dropdown:render](#Dropdown:render)|-|Renders the Dropdown +|Dropdown:init|Dropdown|Initializes the Dropdown instance +|Dropdown:mouse_click|boolean|Handles mouse click events +|Dropdown:render|-|Renders the Dropdown diff --git a/docs/references/elements/Flexbox.md b/docs/references/elements/Flexbox.md index 8aa5a6b..94efc18 100644 --- a/docs/references/elements/Flexbox.md +++ b/docs/references/elements/Flexbox.md @@ -15,17 +15,17 @@ This is the Flexbox class. It is a container that arranges its children in a fle |Method|Returns|Description| |---|---|---| -|[Flexbox:addChild](#Flexbox:addChild)|Flexbox|Adds a child element to the flexbox -|[Flexbox:addLineBreak](#Flexbox:addLineBreak)|Flexbox|Adds a new line break to the flexbox. +|[Flexbox:addChild](#flexbox-addchild)|Flexbox|Adds a child element to the flexbox +|[Flexbox:addLineBreak](#flexbox-addlinebreak)|Flexbox|Adds a new line break to the flexbox. ## Protected Functions |Method|Returns|Description| |---|---|---| -|[Flexbox:init](#Flexbox:init)|Flexbox|Initializes the Flexbox instance -|[Flexbox:removeChild](#Flexbox:removeChild)|Flexbox|Removes a child element from the flexbox -|[Flexbox:render](#Flexbox:render)|Flexbox|Renders the flexbox and its children +|Flexbox:init|Flexbox|Initializes the Flexbox instance +|Flexbox:removeChild|Flexbox|Removes a child element from the flexbox +|Flexbox:render|Flexbox|Renders the flexbox and its children ## Flexbox:addChild(element) Adds a child element to the flexbox diff --git a/docs/references/elements/Frame.md b/docs/references/elements/Frame.md index 746731b..f252f60 100644 --- a/docs/references/elements/Frame.md +++ b/docs/references/elements/Frame.md @@ -8,19 +8,14 @@ This is the frame class. It serves as a grouping container for other elements. |draggable|boolean|false|Whether the frame is draggable |draggingMap|table|{}|The map of dragging positions -## Functions - -|Method|Returns|Description| -|---|---|---| - ## Protected Functions |Method|Returns|Description| |---|---|---| -|[Frame:init](#Frame:init)|Frame|Initializes the Frame instance -|[Frame:mouse_click](#Frame:mouse_click)|boolean|Handles mouse click events -|[Frame:mouse_drag](#Frame:mouse_drag)|boolean|Handles mouse drag events -|[Frame:mouse_up](#Frame:mouse_up)|boolean|Handles mouse release events +|Frame:init|Frame|Initializes the Frame instance +|Frame:mouse_click|boolean|Handles mouse click events +|Frame:mouse_drag|boolean|Handles mouse drag events +|Frame:mouse_up|boolean|Handles mouse release events diff --git a/docs/references/elements/Graph.md b/docs/references/elements/Graph.md index a2dbd70..810978d 100644 --- a/docs/references/elements/Graph.md +++ b/docs/references/elements/Graph.md @@ -13,21 +13,21 @@ This is the base class for all graph elements. It is a point based graph. |Method|Returns|Description| |---|---|---| -|[Graph:addPoint](#Graph:addPoint)|Graph|Adds a point to a series -|[Graph:addSeries](#Graph:addSeries)|-|Adds a series to the graph -|[Graph:changeSeriesVisibility](#Graph:changeSeriesVisibility)|Graph|Changes the visibility of a series -|[Graph:focusSeries](#Graph:focusSeries)|Graph|Focuses a series -|[Graph:getSeries](#Graph:getSeries)|table?|Gets a series from the graph -|[Graph:removeSeries](#Graph:removeSeries)|Graph|Removes a series from the graph -|[Graph:setSeriesPointCount](#Graph:setSeriesPointCount)|Graph|Sets the point count of a series +|[Graph:addPoint](#graph-addpoint)|Graph|Adds a point to a series +|[Graph:addSeries](#graph-addseries)|-|Adds a series to the graph +|[Graph:changeSeriesVisibility](#graph-changeseriesvisibility)|Graph|Changes the visibility of a series +|[Graph:focusSeries](#graph-focusseries)|Graph|Focuses a series +|[Graph:getSeries](#graph-getseries)|table?|Gets a series from the graph +|[Graph:removeSeries](#graph-removeseries)|Graph|Removes a series from the graph +|[Graph:setSeriesPointCount](#graph-setseriespointcount)|Graph|Sets the point count of a series ## Protected Functions |Method|Returns|Description| |---|---|---| -|[Graph:init](#Graph:init)|Graph|Initializes the Graph instance -|[Graph:render](#Graph:render)|-|Renders the graph +|Graph:init|Graph|Initializes the Graph instance +|Graph:render|-|Renders the graph ## Graph:addPoint(name, value) diff --git a/docs/references/elements/Image.md b/docs/references/elements/Image.md index ae7b431..956ea0f 100644 --- a/docs/references/elements/Image.md +++ b/docs/references/elements/Image.md @@ -23,30 +23,30 @@ See: https://github.com/SkyTheCodeMaster/bimg |Method|Returns|Description| |---|---|---| -|[Image:addFrame](#Image:addFrame)|Image|Adds a new frame to the image -|[Image:getBg](#Image:getBg)|string|Gets the background color at the specified position -|[Image:getFg](#Image:getFg)|string|Gets the foreground color at the specified position -|[Image:getFrame](#Image:getFrame)|table|Gets the specified frame -|[Image:getImageSize](#Image:getImageSize)|number|Gets the size of the image -|[Image:getMetadata](#Image:getMetadata)|table|Gets the metadata of the image -|[Image:getPixelData](#Image:getPixelData)|number?|Gets pixel information at position -|[Image:getText](#Image:getText)|string|Gets the text at the specified position -|[Image:nextFrame](#Image:nextFrame)|Image|Advances to the next frame in the animation -|[Image:resizeImage](#Image:resizeImage)|Image|Resizes the image to the specified width and height -|[Image:setBg](#Image:setBg)|Image|Sets the background color at the specified position -|[Image:setFg](#Image:setFg)|Image|Sets the foreground color at the specified position -|[Image:setMetadata](#Image:setMetadata)|Image|Sets the metadata of the image -|[Image:setPixel](#Image:setPixel)|Image|Sets the pixel at the specified position -|[Image:setText](#Image:setText)|Image|Sets the text at the specified position -|[Image:updateFrame](#Image:updateFrame)|Image|Updates the specified frame with the provided data +|[Image:addFrame](#image-addframe)|Image|Adds a new frame to the image +|[Image:getBg](#image-getbg)|string|Gets the background color at the specified position +|[Image:getFg](#image-getfg)|string|Gets the foreground color at the specified position +|[Image:getFrame](#image-getframe)|table|Gets the specified frame +|[Image:getImageSize](#image-getimagesize)|number|Gets the size of the image +|[Image:getMetadata](#image-getmetadata)|table|Gets the metadata of the image +|[Image:getPixelData](#image-getpixeldata)|number?|Gets pixel information at position +|[Image:getText](#image-gettext)|string|Gets the text at the specified position +|[Image:nextFrame](#image-nextframe)|Image|Advances to the next frame in the animation +|[Image:resizeImage](#image-resizeimage)|Image|Resizes the image to the specified width and height +|[Image:setBg](#image-setbg)|Image|Sets the background color at the specified position +|[Image:setFg](#image-setfg)|Image|Sets the foreground color at the specified position +|[Image:setMetadata](#image-setmetadata)|Image|Sets the metadata of the image +|[Image:setPixel](#image-setpixel)|Image|Sets the pixel at the specified position +|[Image:setText](#image-settext)|Image|Sets the text at the specified position +|[Image:updateFrame](#image-updateframe)|Image|Updates the specified frame with the provided data ## Protected Functions |Method|Returns|Description| |---|---|---| -|[Image:init](#Image:init)|Image|Initializes the Image instance -|[Image:render](#Image:render)|-|Renders the Image +|Image:init|Image|Initializes the Image instance +|Image:render|-|Renders the Image ## Image:addFrame() Adds a new frame to the image diff --git a/docs/references/elements/Input.md b/docs/references/elements/Input.md index bdffedf..50a39f3 100644 --- a/docs/references/elements/Input.md +++ b/docs/references/elements/Input.md @@ -16,26 +16,27 @@ cursor movement, text manipulation, placeholder text, and input validation. |focusedForeground|color|white|Foreground color when input is focused |pattern|string?|nil|Regular expression pattern for input validation |cursorColor|number|nil|Color of the cursor +|replaceChar|string|nil|Character to replace the input with (for password fields) ## Functions |Method|Returns|Description| |---|---|---| -|[Input:blur](#Input:blur)|-| -|[Input:focus](#Input:focus)|-| -|[Input:setCursor](#Input:setCursor)|-| -|[Input:updateViewport](#Input:updateViewport)|Input|Updates the input's viewport +|[Input:blur](#input-blur)|-| +|[Input:focus](#input-focus)|-| +|[Input:setCursor](#input-setcursor)|-| +|[Input:updateViewport](#input-updateviewport)|Input|Updates the input's viewport ## Protected Functions |Method|Returns|Description| |---|---|---| -|[Input:char](#Input:char)|boolean|Handles char events -|[Input:init](#Input:init)|Input|Initializes the Input instance -|[Input:key](#Input:key)|boolean|Handles key events -|[Input:mouse_click](#Input:mouse_click)|boolean|Handles mouse click events -|[Input:render](#Input:render)|-|Renders the input element +|Input:char|boolean|Handles char events +|Input:init|Input|Initializes the Input instance +|Input:key|boolean|Handles key events +|Input:mouse_click|boolean|Handles mouse click events +|Input:render|-|Renders the input element ## Input:blur() diff --git a/docs/references/elements/Label.md b/docs/references/elements/Label.md index e909b1c..dcba3e3 100644 --- a/docs/references/elements/Label.md +++ b/docs/references/elements/Label.md @@ -13,15 +13,15 @@ resizes its width based on the text content. |Method|Returns|Description| |---|---|---| -|[Label:getWrappedText](#Label:getWrappedText)|table|Gets the wrapped lines of the Label +|[Label:getWrappedText](#label-getwrappedtext)|table|Gets the wrapped lines of the Label ## Protected Functions |Method|Returns|Description| |---|---|---| -|[Label:init](#Label:init)|Label|Initializes the Label instance -|[Label:render](#Label:render)|-|Renders the Label by drawing its text content +|Label:init|Label|Initializes the Label instance +|Label:render|-|Renders the Label by drawing its text content ## Label:getWrappedText() Gets the wrapped lines of the Label diff --git a/docs/references/elements/LineChart.md b/docs/references/elements/LineChart.md index 86e5bfe..5ac6143 100644 --- a/docs/references/elements/LineChart.md +++ b/docs/references/elements/LineChart.md @@ -1,17 +1,12 @@ # LineChart : Graph This is the line chart class. It is based on the graph element. It draws lines between points. -## Functions - -|Method|Returns|Description| -|---|---|---| - ## Protected Functions |Method|Returns|Description| |---|---|---| -|[LineChart:init](#LineChart:init)|LineChart|Initializes the LineChart instance -|[LineChart:render](#LineChart:render)|-|Renders the LineChart +|LineChart:init|LineChart|Initializes the LineChart instance +|LineChart:render|-|Renders the LineChart diff --git a/docs/references/elements/List.md b/docs/references/elements/List.md index 30d615a..fc408b9 100644 --- a/docs/references/elements/List.md +++ b/docs/references/elements/List.md @@ -23,24 +23,24 @@ custom item rendering, separators, and selection handling. |Method|Returns|Description| |---|---|---| -|[List:addItem](#List:addItem)|List|Adds an item to the list -|[List:clear](#List:clear)|List|Clears all items from the list -|[List:getSelectedItem](#List:getSelectedItem)|table?|Gets first selected item -|[List:getSelectedItems](#List:getSelectedItems)|table|Gets the currently selected items -|[List:onSelect](#List:onSelect)|List|Registers a callback for the select event -|[List:removeItem](#List:removeItem)|List|Removes an item from the list -|[List:scrollToBottom](#List:scrollToBottom)|List|Scrolls the list to the bottom -|[List:scrollToTop](#List:scrollToTop)|List|Scrolls the list to the top +|[List:addItem](#list-additem)|List|Adds an item to the list +|[List:clear](#list-clear)|List|Clears all items from the list +|[List:getSelectedItem](#list-getselecteditem)|table?|Gets first selected item +|[List:getSelectedItems](#list-getselecteditems)|table|Gets the currently selected items +|[List:onSelect](#list-onselect)|List|Registers a callback for the select event +|[List:removeItem](#list-removeitem)|List|Removes an item from the list +|[List:scrollToBottom](#list-scrolltobottom)|List|Scrolls the list to the bottom +|[List:scrollToTop](#list-scrolltotop)|List|Scrolls the list to the top ## Protected Functions |Method|Returns|Description| |---|---|---| -|[List:init](#List:init)|List|Initializes the List instance -|[List:mouse_click](#List:mouse_click)|boolean|Handles mouse click events -|[List:mouse_scroll](#List:mouse_scroll)|boolean|Handles mouse scroll events -|[List:render](#List:render)|-|Renders the list +|List:init|List|Initializes the List instance +|List:mouse_click|boolean|Handles mouse click events +|List:mouse_scroll|boolean|Handles mouse scroll events +|List:render|-|Renders the list ## List:addItem(text) Adds an item to the list diff --git a/docs/references/elements/Menu.md b/docs/references/elements/Menu.md index 90dfc9e..77c9a00 100644 --- a/docs/references/elements/Menu.md +++ b/docs/references/elements/Menu.md @@ -12,16 +12,16 @@ Menu items are displayed in a single row and can have custom colors and callback |Method|Returns|Description| |---|---|---| -|[Menu:setItems](#Menu:setItems)|Menu|Sets the menu items and calculates total width +|[Menu:setItems](#menu-setitems)|Menu|Sets the menu items and calculates total width ## Protected Functions |Method|Returns|Description| |---|---|---| -|[Menu:init](#Menu:init)|Menu|Initializes the Menu instance -|[Menu:mouse_click](#Menu:mouse_click)|boolean|Handles mouse click events and item selection -|[Menu:render](#Menu:render)|-|Renders the menu horizontally with proper spacing and colors +|Menu:init|Menu|Initializes the Menu instance +|Menu:mouse_click|boolean|Handles mouse click events and item selection +|Menu:render|-|Renders the menu horizontally with proper spacing and colors ## Menu:setItems(items) Sets the menu items diff --git a/docs/references/elements/Program.md b/docs/references/elements/Program.md index b7e2941..569279a 100644 --- a/docs/references/elements/Program.md +++ b/docs/references/elements/Program.md @@ -13,17 +13,17 @@ This is the program class. It provides a program that runs in a window. |Method|Returns|Description| |---|---|---| -|[Program:execute](#Program:execute)|Program|Executes a program +|[Program:execute](#program-execute)|Program|Executes a program ## Protected Functions |Method|Returns|Description| |---|---|---| -|[Program:dispatchEvent](#Program:dispatchEvent)|any|Handles all incomming events -|[Program:focus](#Program:focus)|-|Gets called when the element gets focused -|[Program:init](#Program:init)|Program|Initializes the Program instance -|[Program:render](#Program:render)|-|Renders the program +|Program:dispatchEvent|any|Handles all incomming events +|Program:focus|-|Gets called when the element gets focused +|Program:init|Program|Initializes the Program instance +|Program:render|-|Renders the program ## Program:execute(path) Executes a program diff --git a/docs/references/elements/ProgressBar.md b/docs/references/elements/ProgressBar.md index 286b674..d18a098 100644 --- a/docs/references/elements/ProgressBar.md +++ b/docs/references/elements/ProgressBar.md @@ -10,17 +10,12 @@ with optional percentage display and customizable colors. |showPercentage|boolean|false|Whether to show the percentage text in the center |progressColor|color|lime|The color used for the filled portion of the progress bar -## Functions - -|Method|Returns|Description| -|---|---|---| - ## Protected Functions |Method|Returns|Description| |---|---|---| -|[ProgressBar:init](#ProgressBar:init)|ProgressBar|Initializes the ProgressBar instance -|[ProgressBar:render](#ProgressBar:render)|-|Renders the progress bar with filled portion and optional percentage text +|ProgressBar:init|ProgressBar|Initializes the ProgressBar instance +|ProgressBar:render|-|Renders the progress bar with filled portion and optional percentage text diff --git a/docs/references/elements/Scrollbar.md b/docs/references/elements/Scrollbar.md index 0f0c7f1..924fc53 100644 --- a/docs/references/elements/Scrollbar.md +++ b/docs/references/elements/Scrollbar.md @@ -25,19 +25,19 @@ A scrollbar element that can be attached to other elements to control their scro |Method|Returns|Description| |---|---|---| -|[Scrollbar:attach](#Scrollbar:attach)|Scrollbar|Attaches the scrollbar to an element's property -|[Scrollbar:updateAttachedElement](#Scrollbar:updateAttachedElement)|Scrollbar|Updates the attached element's property based on the scrollbar value +|[Scrollbar:attach](#scrollbar-attach)|Scrollbar|Attaches the scrollbar to an element's property +|[Scrollbar:updateAttachedElement](#scrollbar-updateattachedelement)|Scrollbar|Updates the attached element's property based on the scrollbar value ## Protected Functions |Method|Returns|Description| |---|---|---| -|[Scrollbar:init](#Scrollbar:init)|Scrollbar|Initializes the Scrollbar instance -|[Scrollbar:mouse_click](#Scrollbar:mouse_click)|boolean|Handles mouse click events -|[Scrollbar:mouse_drag](#Scrollbar:mouse_drag)|boolean|Handles mouse drag events -|[Scrollbar:mouse_scroll](#Scrollbar:mouse_scroll)|boolean|Handles mouse scroll events -|[Scrollbar:render](#Scrollbar:render)|-|Renders the scrollbar +|Scrollbar:init|Scrollbar|Initializes the Scrollbar instance +|Scrollbar:mouse_click|boolean|Handles mouse click events +|Scrollbar:mouse_drag|boolean|Handles mouse drag events +|Scrollbar:mouse_scroll|boolean|Handles mouse scroll events +|Scrollbar:render|-|Renders the scrollbar ## Scrollbar:attach(element, config) Attaches the scrollbar to an element's property diff --git a/docs/references/elements/Slider.md b/docs/references/elements/Slider.md index 206f82a..0a8e289 100644 --- a/docs/references/elements/Slider.md +++ b/docs/references/elements/Slider.md @@ -22,17 +22,17 @@ with customizable colors and value ranges. |Method|Returns|Description| |---|---|---| -|[Slider:getValue](#Slider:getValue)|number|Gets the current value mapped to the max range +|[Slider:getValue](#slider-getvalue)|number|Gets the current value mapped to the max range ## Protected Functions |Method|Returns|Description| |---|---|---| -|[Slider:init](#Slider:init)|Slider|Initializes the Slider instance -|[Slider:mouse_click](#Slider:mouse_click)|boolean|Updates slider position on mouse click -|[Slider:mouse_scroll](#Slider:mouse_scroll)|boolean|Handles mouse release events -|[Slider:render](#Slider:render)|-|Renders the slider with track and handle +|Slider:init|Slider|Initializes the Slider instance +|Slider:mouse_click|boolean|Updates slider position on mouse click +|Slider:mouse_scroll|boolean|Handles mouse release events +|Slider:render|-|Renders the slider with track and handle ## Slider:getValue() Gets the current value of the slider diff --git a/docs/references/elements/Table.md b/docs/references/elements/Table.md index 3e21330..4878ee4 100644 --- a/docs/references/elements/Table.md +++ b/docs/references/elements/Table.md @@ -20,17 +20,17 @@ row selection, and scrolling capabilities. |Method|Returns|Description| |---|---|---| -|[Table:sortData](#Table:sortData)|Table|Sorts the table data by the specified column +|[Table:sortData](#table-sortdata)|Table|Sorts the table data by the specified column ## Protected Functions |Method|Returns|Description| |---|---|---| -|[Table:init](#Table:init)|Table|Initializes the Table instance -|[Table:mouse_click](#Table:mouse_click)|boolean|Handles header clicks for sorting and row selection -|[Table:mouse_scroll](#Table:mouse_scroll)|boolean|Handles scrolling through the table data -|[Table:render](#Table:render)|-|Renders the table with headers, data and scrollbar +|Table:init|Table|Initializes the Table instance +|Table:mouse_click|boolean|Handles header clicks for sorting and row selection +|Table:mouse_scroll|boolean|Handles scrolling through the table data +|Table:render|-|Renders the table with headers, data and scrollbar ## Table:sortData(columnIndex) Sorts the table data by column diff --git a/docs/references/elements/TextBox.md b/docs/references/elements/TextBox.md index 1374429..3058738 100644 --- a/docs/references/elements/TextBox.md +++ b/docs/references/elements/TextBox.md @@ -18,22 +18,22 @@ A multi-line text editor component with cursor support and text manipulation fea |Method|Returns|Description| |---|---|---| -|[TextBox:addSyntaxPattern](#TextBox:addSyntaxPattern)|TextBox|Adds a new syntax highlighting pattern -|[TextBox:getText](#TextBox:getText)|string|Gets the text of the TextBox -|[TextBox:setText](#TextBox:setText)|TextBox|Sets the text of the TextBox -|[TextBox:updateViewport](#TextBox:updateViewport)|TextBox|Updates the viewport to keep the cursor in view +|[TextBox:addSyntaxPattern](#textbox-addsyntaxpattern)|TextBox|Adds a new syntax highlighting pattern +|[TextBox:getText](#textbox-gettext)|string|Gets the text of the TextBox +|[TextBox:setText](#textbox-settext)|TextBox|Sets the text of the TextBox +|[TextBox:updateViewport](#textbox-updateviewport)|TextBox|Updates the viewport to keep the cursor in view ## Protected Functions |Method|Returns|Description| |---|---|---| -|[TextBox:char](#TextBox:char)|boolean|Handles character input -|[TextBox:init](#TextBox:init)|TextBox|Initializes the TextBox instance -|[TextBox:key](#TextBox:key)|boolean|Handles key events -|[TextBox:mouse_click](#TextBox:mouse_click)|boolean|Handles mouse click events -|[TextBox:mouse_scroll](#TextBox:mouse_scroll)|boolean|Handles mouse scroll events -|[TextBox:render](#TextBox:render)|-|Renders the TextBox with syntax highlighting +|TextBox:char|boolean|Handles character input +|TextBox:init|TextBox|Initializes the TextBox instance +|TextBox:key|boolean|Handles key events +|TextBox:mouse_click|boolean|Handles mouse click events +|TextBox:mouse_scroll|boolean|Handles mouse scroll events +|TextBox:render|-|Renders the TextBox with syntax highlighting ## TextBox:addSyntaxPattern(pattern, color) Adds a new syntax highlighting pattern diff --git a/docs/references/elements/Tree.md b/docs/references/elements/Tree.md index 13bc4ea..040025b 100644 --- a/docs/references/elements/Tree.md +++ b/docs/references/elements/Tree.md @@ -18,21 +18,21 @@ with support for selection and scrolling. |Method|Returns|Description| |---|---|---| -|[Tree:collapseNode](#Tree:collapseNode)|Tree|Collapses a node to hide its children -|[Tree:expandNode](#Tree:expandNode)|Tree|Expands a node to show its children -|[Tree:getNodeSize](#Tree:getNodeSize)|number|Gets the size of the tree -|[Tree:onSelect](#Tree:onSelect)|Tree|Registers a callback for when a node is selected -|[Tree:toggleNode](#Tree:toggleNode)|Tree|Toggles between expanded and collapsed state +|[Tree:collapseNode](#tree-collapsenode)|Tree|Collapses a node to hide its children +|[Tree:expandNode](#tree-expandnode)|Tree|Expands a node to show its children +|[Tree:getNodeSize](#tree-getnodesize)|number|Gets the size of the tree +|[Tree:onSelect](#tree-onselect)|Tree|Registers a callback for when a node is selected +|[Tree:toggleNode](#tree-togglenode)|Tree|Toggles between expanded and collapsed state ## Protected Functions |Method|Returns|Description| |---|---|---| -|[Tree:init](#Tree:init)|Tree|Initializes the Tree instance -|[Tree:mouse_click](#Tree:mouse_click)|boolean|Handles mouse click events for node selection and expansion -|[Tree:mouse_scroll](#Tree:mouse_scroll)|boolean|Handles mouse scroll events for vertical scrolling -|[Tree:render](#Tree:render)|-|Renders the tree with nodes, selection and scrolling +|Tree:init|Tree|Initializes the Tree instance +|Tree:mouse_click|boolean|Handles mouse click events for node selection and expansion +|Tree:mouse_scroll|boolean|Handles mouse scroll events for vertical scrolling +|Tree:render|-|Renders the tree with nodes, selection and scrolling ## Tree:collapseNode(node) Collapses a node diff --git a/docs/references/elements/VisualElement.md b/docs/references/elements/VisualElement.md index d29ae90..96290f0 100644 --- a/docs/references/elements/VisualElement.md +++ b/docs/references/elements/VisualElement.md @@ -49,35 +49,35 @@ and provides core functionality for positioning, sizing, colors, and rendering. |Method|Returns|Description| |---|---|---| -|[VisualElement:calculatePosition](#VisualElement:calculatePosition)|number|Calculates the position of the element -|[VisualElement:getAbsolutePosition](#VisualElement:getAbsolutePosition)|number|Returns the absolute position of the element -|[VisualElement:getRelativePosition](#VisualElement:getRelativePosition)|number|Returns the relative position of the element -|[VisualElement:isInBounds](#VisualElement:isInBounds)|boolean|Checks if point is within bounds -|[VisualElement:prioritize](#VisualElement:prioritize)|VisualElement|Prioritizes the element by moving it to the top of its parent's children +|[VisualElement:calculatePosition](#visualelement-calculateposition)|number|Calculates the position of the element +|[VisualElement:getAbsolutePosition](#visualelement-getabsoluteposition)|number|Returns the absolute position of the element +|[VisualElement:getRelativePosition](#visualelement-getrelativeposition)|number|Returns the relative position of the element +|[VisualElement:isInBounds](#visualelement-isinbounds)|boolean|Checks if point is within bounds +|[VisualElement:prioritize](#visualelement-prioritize)|VisualElement|Prioritizes the element by moving it to the top of its parent's children ## Protected Functions |Method|Returns|Description| |---|---|---| -|[VisualElement:blit](#VisualElement:blit)|-|Draws text with both colors -|[VisualElement:blur](#VisualElement:blur)|-|Handles a blur event -|[VisualElement:char](#VisualElement:char)|-|Handles a character event -|[VisualElement:focus](#VisualElement:focus)|-|Handles a focus event -|[VisualElement:init](#VisualElement:init)|-|Initializes a new visual element with properties -|[VisualElement:key](#VisualElement:key)|-|Handles a key event -|[VisualElement:key_up](#VisualElement:key_up)|-|Handles a key up event -|[VisualElement:mouse_click](#VisualElement:mouse_click)|boolean|Handles a mouse click event -|[VisualElement:mouse_drag](#VisualElement:mouse_drag)|boolean|Handles a mouse drag event -|[VisualElement:mouse_move](#VisualElement:mouse_move)|boolean|Handles a mouse move event -|[VisualElement:mouse_release](#VisualElement:mouse_release)|-|Handles a mouse release event -|[VisualElement:mouse_scroll](#VisualElement:mouse_scroll)|boolean|Handles a mouse scroll event -|[VisualElement:mouse_up](#VisualElement:mouse_up)|boolean|Handles a mouse up event -|[VisualElement:multiBlit](#VisualElement:multiBlit)|-|Multi-character drawing with colors -|[VisualElement:render](#VisualElement:render)|-|Renders the element -|[VisualElement:setCursor](#VisualElement:setCursor)|VisualElement|Sets the cursor position -|[VisualElement:textBg](#VisualElement:textBg)|-|Draws text with background color -|[VisualElement:textFg](#VisualElement:textFg)|-|Draws text with foreground color +|VisualElement:blit|-|Draws text with both colors +|VisualElement:blur|-|Handles a blur event +|VisualElement:char|-|Handles a character event +|VisualElement:focus|-|Handles a focus event +|VisualElement:init|-|Initializes a new visual element with properties +|VisualElement:key|-|Handles a key event +|VisualElement:key_up|-|Handles a key up event +|VisualElement:mouse_click|boolean|Handles a mouse click event +|VisualElement:mouse_drag|boolean|Handles a mouse drag event +|VisualElement:mouse_move|boolean|Handles a mouse move event +|VisualElement:mouse_release|-|Handles a mouse release event +|VisualElement:mouse_scroll|boolean|Handles a mouse scroll event +|VisualElement:mouse_up|boolean|Handles a mouse up event +|VisualElement:multiBlit|-|Multi-character drawing with colors +|VisualElement:render|-|Renders the element +|VisualElement:setCursor|VisualElement|Sets the cursor position +|VisualElement:textBg|-|Draws text with background color +|VisualElement:textFg|-|Draws text with foreground color ## VisualElement:calculatePosition() Calculates the position of the element relative to its parent diff --git a/docs/references/errorManager.md b/docs/references/errorManager.md index b27bc0c..20e1996 100644 --- a/docs/references/errorManager.md +++ b/docs/references/errorManager.md @@ -12,7 +12,7 @@ This is Basalt's error handler. All the errors are handled by this module. |Method|Returns|Description| |---|---|---| -|[errorHandler.error](#errorHandler.error)|-| +|[errorHandler.error](#errorhandler-error)|-| ## errorHandler.error(errMsg) diff --git a/docs/references/log.md b/docs/references/log.md index 2178f4c..86604b0 100644 --- a/docs/references/log.md +++ b/docs/references/log.md @@ -15,12 +15,12 @@ Logger module for Basalt. Logs messages to the console and optionally to a file. |Method|Returns|Description| |---|---|---| -|[Log.debug](#Log.debug)|-|Sends a debug message -|[Log.error](#Log.error)|-|Sends an error message -|[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.debug](#log-debug)|-|Sends a debug message +|[Log.error](#log-error)|-|Sends an error message +|[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.debug(...) diff --git a/docs/references/main.md b/docs/references/main.md index c98f181..49cb01d 100644 --- a/docs/references/main.md +++ b/docs/references/main.md @@ -26,19 +26,19 @@ What this code does is it loads basalt into the project, and you can access it b |Method|Returns|Description| |---|---|---| -|[basalt.create](#basalt.create)|table|Creates a new UI element -|[basalt.createFrame](#basalt.createFrame)|BaseFrame|Creates a new BaseFrame -|[basalt.getAPI](#basalt.getAPI)|table|Returns a Plugin API -|[basalt.getActiveFrame](#basalt.getActiveFrame)|BaseFrame?|Returns the active frame -|[basalt.getElementClass](#basalt.getElementClass)|table|Returns an element class -|[basalt.getElementManager](#basalt.getElementManager)|table|Returns the element manager -|[basalt.getMainFrame](#basalt.getMainFrame)|BaseFrame|Gets or creates the main frame -|[basalt.removeSchedule](#basalt.removeSchedule)|boolean|Removes a scheduled update -|[basalt.run](#basalt.run)|-|Starts the Basalt runtime -|[basalt.schedule](#basalt.schedule)|thread|Schedules a function to run in a coroutine -|[basalt.setActiveFrame](#basalt.setActiveFrame)|-|Sets the active frame -|[basalt.stop](#basalt.stop)|-|Stops the Basalt runtime -|[basalt.update](#basalt.update)|-|Runs basalt once +|[basalt.create](#basalt-create)|table|Creates a new UI element +|[basalt.createFrame](#basalt-createframe)|BaseFrame|Creates a new BaseFrame +|[basalt.getAPI](#basalt-getapi)|table|Returns a Plugin API +|[basalt.getActiveFrame](#basalt-getactiveframe)|BaseFrame?|Returns the active frame +|[basalt.getElementClass](#basalt-getelementclass)|table|Returns an element class +|[basalt.getElementManager](#basalt-getelementmanager)|table|Returns the element manager +|[basalt.getMainFrame](#basalt-getmainframe)|BaseFrame|Gets or creates the main frame +|[basalt.removeSchedule](#basalt-removeschedule)|boolean|Removes a scheduled update +|[basalt.run](#basalt-run)|-|Starts the Basalt runtime +|[basalt.schedule](#basalt-schedule)|thread|Schedules a function to run in a coroutine +|[basalt.setActiveFrame](#basalt-setactiveframe)|-|Sets the active frame +|[basalt.stop](#basalt-stop)|-|Stops the Basalt runtime +|[basalt.update](#basalt-update)|-|Runs basalt once ## basalt.create(type, properties?) diff --git a/docs/references/plugins/animation.md b/docs/references/plugins/animation.md index 9bbdadb..d0ebcd6 100644 --- a/docs/references/plugins/animation.md +++ b/docs/references/plugins/animation.md @@ -6,16 +6,16 @@ with support for sequences, easing functions, and multiple animation types. |Method|Returns|Description| |---|---|---| -|[Animation.new](#Animation.new)|Animation|Creates a new animation -|[Animation.registerAnimation](#Animation.registerAnimation)|-|Registers a custom animation type -|[Animation.registerEasing](#Animation.registerEasing)|-|Adds a custom easing function -|[Animation:addAnimation](#Animation:addAnimation)|-|Adds a new animation to the sequence -|[Animation:event](#Animation:event)|-|The event handler for the animation -|[Animation:onComplete](#Animation:onComplete)|Animation|Registers a callback for the complete event -|[Animation:onStart](#Animation:onStart)|-|Registers a callback for the start event -|[Animation:onUpdate](#Animation:onUpdate)|Animation|Registers a callback for the update event -|[Animation:sequence](#Animation:sequence)|Animation|Creates a new sequence -|[Animation:start](#Animation:start)|Animation|Starts the animation +|[Animation.new](#animation-new)|Animation|Creates a new animation +|[Animation.registerAnimation](#animation-registeranimation)|-|Registers a custom animation type +|[Animation.registerEasing](#animation-registereasing)|-|Adds a custom easing function +|[Animation:addAnimation](#animation-addanimation)|-|Adds a new animation to the sequence +|[Animation:event](#animation-event)|-|The event handler for the animation +|[Animation:onComplete](#animation-oncomplete)|Animation|Registers a callback for the complete event +|[Animation:onStart](#animation-onstart)|-|Registers a callback for the start event +|[Animation:onUpdate](#animation-onupdate)|Animation|Registers a callback for the update event +|[Animation:sequence](#animation-sequence)|Animation|Creates a new sequence +|[Animation:start](#animation-start)|Animation|Starts the animation ## Animation.new(element) diff --git a/docs/references/plugins/animation_AnimationInstance.md b/docs/references/plugins/animation_AnimationInstance.md index 22f0222..44bc8d6 100644 --- a/docs/references/plugins/animation_AnimationInstance.md +++ b/docs/references/plugins/animation_AnimationInstance.md @@ -18,10 +18,10 @@ This is the AnimationInstance class. It represents a single animation instance |Method|Returns|Description| |---|---|---| -|[AnimationInstance.new](#AnimationInstance.new)|AnimationInstance|Creates a new animation instance -|[AnimationInstance:complete](#AnimationInstance:complete)|-|Called when the animation is completed -|[AnimationInstance:start](#AnimationInstance:start)|AnimationInstance|Starts the animation -|[AnimationInstance:update](#AnimationInstance:update)|boolean|Updates the animation +|[AnimationInstance.new](#animationinstance-new)|AnimationInstance|Creates a new animation instance +|[AnimationInstance:complete](#animationinstance-complete)|-|Called when the animation is completed +|[AnimationInstance:start](#animationinstance-start)|AnimationInstance|Starts the animation +|[AnimationInstance:update](#animationinstance-update)|boolean|Updates the animation ## AnimationInstance.new(element, animType, args, duration, easing) diff --git a/docs/references/plugins/animation_VisualElement.md b/docs/references/plugins/animation_VisualElement.md index 550cf77..78b30ca 100644 --- a/docs/references/plugins/animation_VisualElement.md +++ b/docs/references/plugins/animation_VisualElement.md @@ -5,7 +5,7 @@ Adds additional methods for VisualElement when adding animation plugin |Method|Returns|Description| |---|---|---| -|[VisualElement:animate](#VisualElement:animate)|Animation|Creates a new animation +|[VisualElement:animate](#visualelement-animate)|Animation|Creates a new animation ## VisualElement:animate() diff --git a/docs/references/plugins/benchmark.md b/docs/references/plugins/benchmark.md index c075aa8..82636ec 100644 --- a/docs/references/plugins/benchmark.md +++ b/docs/references/plugins/benchmark.md @@ -5,11 +5,11 @@ Benchmark API methods |Method|Returns|Description| |---|---|---| -|[API.clear](#API.clear)|-|Removes a benchmark's data -|[API.clearAll](#API.clearAll)|-|Removes all custom benchmark data -|[API.getStats](#API.getStats)|table?|Retrieves benchmark statistics -|[API.start](#API.start)|-|Starts timing a custom operation -|[API.stop](#API.stop)|-|Stops timing and logs results +|[API.clear](#api-clear)|-|Removes a benchmark's data +|[API.clearAll](#api-clearall)|-|Removes all custom benchmark data +|[API.getStats](#api-getstats)|table?|Retrieves benchmark statistics +|[API.start](#api-start)|-|Starts timing a custom operation +|[API.stop](#api-stop)|-|Stops timing and logs results ## API.clear(name) @@ -35,7 +35,7 @@ Starts a custom benchmark ### Parameters * `name` `string` The name of the benchmark -* `options` *(optional)* `table` Optional configuration +* `options` *(optional)* `table` Optional configuration ## API.stop(name) Stops a custom benchmark diff --git a/docs/references/plugins/benchmark_BaseElement.md b/docs/references/plugins/benchmark_BaseElement.md index 7e40a60..a29f8b7 100644 --- a/docs/references/plugins/benchmark_BaseElement.md +++ b/docs/references/plugins/benchmark_BaseElement.md @@ -7,12 +7,12 @@ The following methods are available for BaseElement |Method|Returns|Description| |---|---|---| -|[BaseElement:benchmark](#BaseElement:benchmark)|BaseElement|Enables performance measurement for a method -|[BaseElement:endProfile](#BaseElement:endProfile)|BaseElement|Ends timing a method call and records statistics -|[BaseElement:getBenchmarkStats](#BaseElement:getBenchmarkStats)|table?|Retrieves benchmark statistics for a method -|[BaseElement:logBenchmark](#BaseElement:logBenchmark)|BaseElement|Logs benchmark statistics for a method -|[BaseElement:startProfile](#BaseElement:startProfile)|BaseElement|Starts timing a method call -|[BaseElement:stopBenchmark](#BaseElement:stopBenchmark)|BaseElement|Disables performance measurement for a method +|[BaseElement:benchmark](#baseelement-benchmark)|BaseElement|Enables performance measurement for a method +|[BaseElement:endProfile](#baseelement-endprofile)|BaseElement|Ends timing a method call and records statistics +|[BaseElement:getBenchmarkStats](#baseelement-getbenchmarkstats)|table?|Retrieves benchmark statistics for a method +|[BaseElement:logBenchmark](#baseelement-logbenchmark)|BaseElement|Logs benchmark statistics for a method +|[BaseElement:startProfile](#baseelement-startprofile)|BaseElement|Starts timing a method call +|[BaseElement:stopBenchmark](#baseelement-stopbenchmark)|BaseElement|Disables performance measurement for a method ## BaseElement:benchmark(methodName) diff --git a/docs/references/plugins/benchmark_Container_VisualElement.md b/docs/references/plugins/benchmark_Container_VisualElement.md new file mode 100644 index 0000000..587ab66 --- /dev/null +++ b/docs/references/plugins/benchmark_Container_VisualElement.md @@ -0,0 +1,44 @@ +# Container : VisualElement + +## Functions + +|Method|Returns|Description| +|---|---|---| +|[Container:benchmarkContainer](#container-benchmarkcontainer)|Container|Recursively enables benchmarking +|[Container:logContainerBenchmarks](#container-logcontainerbenchmarks)|Container|Recursively logs benchmark statistics +|[Container:stopContainerBenchmark](#container-stopcontainerbenchmark)|Container|Recursively stops benchmarking + + +## Container:benchmarkContainer(methodName) +Enables benchmarking for a container and all its children + +### Parameters +* `methodName` `string` The method to benchmark + +### Returns +* `Container` `self` The container instance + +### Usage + ```lua +container:benchmarkContainer("render") +``` + +## Container:logContainerBenchmarks(methodName) +Logs benchmark statistics for a container and all its children + +### Parameters +* `methodName` `string` The method to log + +### Returns +* `Container` `self` The container instance + +## Container:stopContainerBenchmark(methodName) +Stops benchmarking for a container and all its children + +### Parameters +* `methodName` `string` The method to stop benchmarking + +### Returns +* `Container` `self` The container instance + + diff --git a/docs/references/plugins/debug.md b/docs/references/plugins/debug.md index d2cdf27..5c62a3f 100644 --- a/docs/references/plugins/debug.md +++ b/docs/references/plugins/debug.md @@ -5,8 +5,8 @@ No Description |Method|Returns|Description| |---|---|---| -|[BaseElement.debug](#BaseElement.debug)|-|Enables debugging for this element -|[BaseElement.dumpDebug](#BaseElement.dumpDebug)|-|Dumps debug information +|[BaseElement.debug](#baseelement-debug)|-|Enables debugging for this element +|[BaseElement.dumpDebug](#baseelement-dumpdebug)|-|Dumps debug information ## BaseElement.debug(self, level) @@ -32,9 +32,9 @@ Dumps debug information for this element |Method|Returns|Description| |---|---|---| -|[BaseFrame.hideDebugLog](#BaseFrame.hideDebugLog)|-|Hides the debug log frame -|[BaseFrame.showDebugLog](#BaseFrame.showDebugLog)|-|Shows the debug log frame -|[BaseFrame.toggleDebugLog](#BaseFrame.toggleDebugLog)|-|Toggles the debug log frame +|[BaseFrame.hideDebugLog](#baseframe-hidedebuglog)|-|Hides the debug log frame +|[BaseFrame.showDebugLog](#baseframe-showdebuglog)|-|Shows the debug log frame +|[BaseFrame.toggleDebugLog](#baseframe-toggledebuglog)|-|Toggles the debug log frame ## BaseFrame.hideDebugLog(self) @@ -65,7 +65,7 @@ Toggles the debug log frame |Method|Returns|Description| |---|---|---| -|[Container.debugChildren](#Container.debugChildren)|-|Debug container and children +|[Container.debugChildren](#container-debugchildren)|-|Debug container and children ## Container.debugChildren(self, level) diff --git a/docs/references/plugins/reactive.md b/docs/references/plugins/reactive.md index e46a0d2..30ba8b9 100644 --- a/docs/references/plugins/reactive.md +++ b/docs/references/plugins/reactive.md @@ -2,10 +2,5 @@ This module provides reactive functionality for elements, it adds no new functionality for elements. It is used to evaluate expressions in property values and update the element when the expression changes. -## Functions - -|Method|Returns|Description| -|---|---|---| - diff --git a/docs/references/plugins/state.md b/docs/references/plugins/state.md index 29d64bb..578bf73 100644 --- a/docs/references/plugins/state.md +++ b/docs/references/plugins/state.md @@ -6,12 +6,12 @@ persistent states, computed states, and state sharing between elements. |Method|Returns|Description| |---|---|---| -|[BaseElement:computed](#BaseElement:computed)|BaseElement|Creates a computed state -|[BaseElement:getState](#BaseElement:getState)|any|Gets a state value -|[BaseElement:initializeState](#BaseElement:initializeState)|BaseElement|Initializes a new state -|[BaseElement:onStateChange](#BaseElement:onStateChange)|BaseElement|Watches for state changes -|[BaseElement:setState](#BaseElement:setState)|BaseElement|Sets a state value -|[BaseElement:shareState](#BaseElement:shareState)|BaseElement|Shares state between elements +|[BaseElement:computed](#baseelement-computed)|BaseElement|Creates a computed state +|[BaseElement:getState](#baseelement-getstate)|any|Gets a state value +|[BaseElement:initializeState](#baseelement-initializestate)|BaseElement|Initializes a new state +|[BaseElement:onStateChange](#baseelement-onstatechange)|BaseElement|Watches for state changes +|[BaseElement:setState](#baseelement-setstate)|BaseElement|Sets a state value +|[BaseElement:shareState](#baseelement-sharestate)|BaseElement|Shares state between elements ## BaseElement:computed(self, key, computeFn) diff --git a/docs/references/plugins/theme.md b/docs/references/plugins/theme.md index c6bdb16..652e5a2 100644 --- a/docs/references/plugins/theme.md +++ b/docs/references/plugins/theme.md @@ -6,8 +6,8 @@ with support for inheritance, named styles, and dynamic theme switching. |Method|Returns|Description| |---|---|---| -|[BaseElement:applyTheme](#BaseElement:applyTheme)|BaseElement|Applies theme styles to the element -|[BaseElement:getTheme](#BaseElement:getTheme)|table|Gets theme properties for the element +|[BaseElement:applyTheme](#baseelement-applytheme)|BaseElement|Applies theme styles to the element +|[BaseElement:getTheme](#baseelement-gettheme)|table|Gets theme properties for the element ## BaseElement:applyTheme(self) @@ -39,9 +39,9 @@ The Theme API provides methods for managing themes globally |Method|Returns|Description| |---|---|---| -|[ThemeAPI.getTheme](#ThemeAPI.getTheme)|table|Gets the current theme -|[ThemeAPI.loadTheme](#ThemeAPI.loadTheme)|-|Loads theme from JSON file -|[ThemeAPI.setTheme](#ThemeAPI.setTheme)|-|Sets a new theme +|[ThemeAPI.getTheme](#themeapi-gettheme)|table|Gets the current theme +|[ThemeAPI.loadTheme](#themeapi-loadtheme)|-|Loads theme from JSON file +|[ThemeAPI.setTheme](#themeapi-settheme)|-|Sets a new theme ## ThemeAPI.getTheme() diff --git a/docs/references/propertySystem.md b/docs/references/propertySystem.md index b147c17..b97c02e 100644 --- a/docs/references/propertySystem.md +++ b/docs/references/propertySystem.md @@ -16,19 +16,19 @@ It also allows for properties to have custom getters and setters. This is the ba |Method|Returns|Description| |---|---|---| -|[PropertySystem.addSetterHook](#PropertySystem.addSetterHook)|-|Adds a setter hook to the PropertySystem -|[PropertySystem.blueprint](#PropertySystem.blueprint)|table|Creates a blueprint of an element class -|[PropertySystem.combineProperties](#PropertySystem.combineProperties)|-|Combines multiple properties -|[PropertySystem.createFromBlueprint](#PropertySystem.createFromBlueprint)|table|Creates an element from a blueprint -|[PropertySystem.defineProperty](#PropertySystem.defineProperty)|-|Defines a property for an element class -|[PropertySystem:__init](#PropertySystem:__init)|table|Initializes the PropertySystem -|[PropertySystem:_updateProperty](#PropertySystem:_updateProperty)|table|Update call for a property -|[PropertySystem:getPropertyConfig](#PropertySystem:getPropertyConfig)|table|Gets a property configuration -|[PropertySystem:instanceProperty](#PropertySystem:instanceProperty)|table|Adds a property to the PropertySystem on instance level -|[PropertySystem:observe](#PropertySystem:observe)|table|Observers a property -|[PropertySystem:removeAllObservers](#PropertySystem:removeAllObservers)|table|Removes all observers from a property -|[PropertySystem:removeObserver](#PropertySystem:removeObserver)|table|Removes an observer from a property -|[PropertySystem:removeProperty](#PropertySystem:removeProperty)|table|Removes a property from the PropertySystem +|[PropertySystem.addSetterHook](#propertysystem-addsetterhook)|-|Adds a setter hook to the PropertySystem +|[PropertySystem.blueprint](#propertysystem-blueprint)|table|Creates a blueprint of an element class +|[PropertySystem.combineProperties](#propertysystem-combineproperties)|-|Combines multiple properties +|[PropertySystem.createFromBlueprint](#propertysystem-createfromblueprint)|table|Creates an element from a blueprint +|[PropertySystem.defineProperty](#propertysystem-defineproperty)|-|Defines a property for an element class +|[PropertySystem:__init](#propertysystem-__init)|table|Initializes the PropertySystem +|[PropertySystem:_updateProperty](#propertysystem-_updateproperty)|table|Update call for a property +|[PropertySystem:getPropertyConfig](#propertysystem-getpropertyconfig)|table|Gets a property configuration +|[PropertySystem:instanceProperty](#propertysystem-instanceproperty)|table|Adds a property to the PropertySystem on instance level +|[PropertySystem:observe](#propertysystem-observe)|table|Observers a property +|[PropertySystem:removeAllObservers](#propertysystem-removeallobservers)|table|Removes all observers from a property +|[PropertySystem:removeObserver](#propertysystem-removeobserver)|table|Removes an observer from a property +|[PropertySystem:removeProperty](#propertysystem-removeproperty)|table|Removes a property from the PropertySystem ## PropertySystem.addSetterHook(hook) diff --git a/docs/references/render.md b/docs/references/render.md index 58293f0..165a603 100644 --- a/docs/references/render.md +++ b/docs/references/render.md @@ -18,23 +18,23 @@ functionality. It also has a buffer system to reduce the number of calls |Method|Returns|Description| |---|---|---| -|[Render.new](#Render.new)|Render| -|[Render:addDirtyRect](#Render:addDirtyRect)|Render| -|[Render:bg](#Render:bg)|Render| -|[Render:blit](#Render:blit)|Render| -|[Render:clear](#Render:clear)|Render| -|[Render:clearArea](#Render:clearArea)|Render| -|[Render:fg](#Render:fg)|Render| -|[Render:getSize](#Render:getSize)|number,| -|[Render:mergeRects](#Render:mergeRects)|Render| -|[Render:multiBlit](#Render:multiBlit)|Render| -|[Render:rectOverlaps](#Render:rectOverlaps)|boolean| -|[Render:render](#Render:render)|Render| -|[Render:setCursor](#Render:setCursor)|Render| -|[Render:setSize](#Render:setSize)|Render| -|[Render:text](#Render:text)|Render| -|[Render:textBg](#Render:textBg)|Render| -|[Render:textFg](#Render:textFg)|Render| +|[Render.new](#render-new)|Render| +|[Render:addDirtyRect](#render-adddirtyrect)|Render| +|[Render:bg](#render-bg)|Render| +|[Render:blit](#render-blit)|Render| +|[Render:clear](#render-clear)|Render| +|[Render:clearArea](#render-cleararea)|Render| +|[Render:fg](#render-fg)|Render| +|[Render:getSize](#render-getsize)|number,| +|[Render:mergeRects](#render-mergerects)|Render| +|[Render:multiBlit](#render-multiblit)|Render| +|[Render:rectOverlaps](#render-rectoverlaps)|boolean| +|[Render:render](#render-render)|Render| +|[Render:setCursor](#render-setcursor)|Render| +|[Render:setSize](#render-setsize)|Render| +|[Render:text](#render-text)|Render| +|[Render:textBg](#render-textbg)|Render| +|[Render:textFg](#render-textfg)|Render| ## Render.new(terminal)