-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
299 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Better Backgrounds | ||
|
||
The Better Backgrounds extension allows the use of characters or strings as backgrounds. | ||
|
||
## Properties | ||
|
||
|Property|Type|Description| | ||
|---|---|---| | ||
|backgroundSymbol|string|Specifies the symbol or string to use as the background of the element. It will be repeated to fill the entire background. | ||
|backgroundSymbolColor|color|Specifies the color of the background symbol. Default: red | ||
|
||
## Usage | ||
|
||
To use the Better Backgrounds extension in Basalt, simply apply the desired background properties to your elements. For example: | ||
|
||
```lua | ||
local main = basalt.getMainFrame() | ||
local frame = main:addFrame():setPosition(2, 2) | ||
|
||
frame:setBackgroundSymbol("#"):setBackgroundSymbolColor(colors.blue) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Borders | ||
|
||
The Borders extension in Basalt adds customizable border properties to elements. This guide provides an overview of the properties available with the Borders extension and how to use them effectively. | ||
|
||
## Properties | ||
|
||
|Property|Type|Description| | ||
|---|---|---| | ||
|border|bool|Specifies whether the element has a border. | ||
|borderClickable|bool|Specifies whether the border of the element is clickable (interactable). | ||
|borderSides|table|Specifies which sides of the element have borders. | ||
|borderType|string|Specifies the type of border to apply. Available options include "small" or "solid". | ||
|borderColor|color|Specifies the color of the border. | ||
|
||
## Methods | ||
|
||
|Method|Returns|Description| | ||
|---|---|---| | ||
|setBorderSide|self|Sets the visibility of a specific border side for the element. | ||
|getBorderSide|bool|Gets the visibility state of a specific border side for the element | ||
|
||
## Usage | ||
|
||
To use the Borders extension, simply apply the desired border properties to your elements. For example: | ||
|
||
```lua | ||
local main = basalt.getMainFrame() | ||
local button = main:addButton() | ||
|
||
button:setBorder(true):setBorderColor(colors.blue) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Debug | ||
|
||
The Debug extension is designed to facilitate the development of programs by providing tools for debugging and logging information. This guide provides an overview of the methods available with the Debug extension and how to use them effectively. | ||
|
||
## Methods | ||
|
||
|Method|Returns|Description| | ||
|---|---|---| | ||
|basalt.openDebugPanel|-|Opens or closes the debug panel, which displays debug information. | ||
|basalt.debug|-|Logs the specified text to the debug panel for debugging purposes. | ||
|
||
## Usage | ||
|
||
To use the Debug extension in Basalt, simply call the provided methods in your code as needed. For example: | ||
|
||
```lua | ||
-- Open the debug panel | ||
basalt.openDebugPanel(true) | ||
|
||
-- Log debug information | ||
basalt.debug("Initializing application...") | ||
|
||
-- More code... | ||
|
||
-- Log additional information | ||
basalt.debug("Application initialized successfully.") | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# References | ||
|
||
Welcome to the Basalt API References! This section provides a guide to the elements and extensions available in Basalt. | ||
|
||
## Elements | ||
|
||
Elements in Basalt are the building blocks for creating user interfaces. Each element provides specific functionality and properties that can be customized. | ||
|
||
## Extensions | ||
|
||
Extensions in Basalt are additional features or functionalities that extend the capabilities of the framework beyond the built-in elements. These extensions provide tools and utilities to enhance the development experience and create more advanced UIs. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Scrollbars | ||
|
||
The Scrollbars extension enhances the functionality of Container, TextField, and List elements by adding the ability to include scrollbars. | ||
|
||
## Methods | ||
|
||
|Method|Returns|Description| | ||
|---|---|---| | ||
|enableScrollbar|self|Enables the scrollbar for the element, allowing users to scroll through its content via a bar. | ||
|disableScrollbar|self|Disables the scrollbar for the element. | ||
|
||
## Usage | ||
|
||
To use the Scrollbars extension in Basalt, simply call the provided methods on the supported elements. For example: | ||
|
||
```lua | ||
local main = basalt.getMainFrame() | ||
|
||
local frame = main:addFrame() | ||
local list = main:addList() | ||
local textfield = main:addTextfield() | ||
|
||
-- Enable scrollbar for a frame element | ||
frame:enableScrollbar() | ||
|
||
-- Enable scrollbar for a list element | ||
list:enableScrollbar() | ||
|
||
-- Enable scrollbar for a textfield element | ||
textfield:enableScrollbar() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,20 @@ | ||
# Shadows | ||
|
||
The Shadows extension in Basalt enhances the visual appearance of elements by adding shadows. This guide provides an overview of the properties available with the Shadows extension and how to use them effectively. | ||
|
||
## Properties | ||
|
||
|Property|Type|Description| | ||
|---|---|---| | ||
|shadow|bool|Specifies whether the element has a shadow. | ||
|shadowDirection|bool|Specifies the direction of the shadow effect. Available options include "topLeft", "topRight", "bottomLeft", and "bottomRight". | ||
|shadowColor|table|Specifies the color of the shadow. | ||
|
||
To use the Shadows extension in Basalt, simply apply the desired shadow properties to your elements. For example: | ||
|
||
```lua | ||
local main = basalt.getMainFrame() | ||
local frame = main:addFrame():setPosition(2, 2) | ||
|
||
frame:setShadow(true):setShadowColor(colors.blue) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# XML | ||
|
||
Basalt provides a convenient way to create and load user interface (UI) elements using XML (eXtensible Markup Language). XML allows you to define the structure and properties of UI elements in a human-readable format, making it easier to manage complex UI layouts. | ||
|
||
## Creating UI Elements in XML | ||
|
||
In XML, each UI element is represented by a tag, and its properties are specified as attributes within the tag. Here's a basic example of how to create a button element in XML: | ||
|
||
```xml | ||
<button x="10" y="10" width="100" height="30" text="Click Me" /> | ||
``` | ||
|
||
You can add additional attributes to customize the appearance and behavior of UI elements further. Refer to the Basalt documentation for a list of supported attributes for each UI element. | ||
|
||
## Creating Events for UI Elements in XML | ||
|
||
In XML, you can also define event handlers for UI elements to specify actions to be performed when certain events occur. For example, to add an onClick event to a button element, you can include the event handler within the button tag as follows: | ||
|
||
```xml | ||
<button x="10" y="10" width="100" height="30" text="Click Me"> | ||
<onClick> | ||
basalt.debug("Button got clicked") | ||
</onClick> | ||
</button> | ||
``` | ||
|
||
## Loading XML Files in Basalt | ||
|
||
Once you've created your UI elements in XML, you can load them into your Basalt application using the `element:loadXML()` method. This method parses the XML file and creates the corresponding UI element in your application. | ||
|
||
```lua | ||
local basalt = require("basalt") | ||
local main = basalt.getMainFrame() | ||
|
||
-- Load UI elements from XML file | ||
main:loadXML("ui_layout.xml") | ||
|
||
basalt.run() | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters