Basalt 1.7 Update
- New Objects (Flexbox, Graph, Treeview) - Pluginsystem to add/remove functionality - Reworked the entire Object system, instead of one big Object Class we have multiple classes: Object, VisualObject, ChangeableObject - Instead of one big Frame Class we have multiple Frame Classes: BaseFrame, Frame, MovableFrame, ScrollableFrame, MonitorFrame, Flexbox - Removed the Animation Object, and added a animation plugin instead - Removed the Graphic Object and merged it's functionality with the image object - Updated currently existing objects
This commit is contained in:
@@ -1,14 +1,28 @@
|
||||
## getProgress
|
||||
|
||||
### Description
|
||||
|
||||
Returns the current progress status
|
||||
|
||||
#### Returns:
|
||||
### Returns
|
||||
|
||||
1. `number` progress (0-100)
|
||||
|
||||
#### Usage:
|
||||
* Creates a progressbar, sets the current progress to 50 and prints the current progress
|
||||
### Usage
|
||||
|
||||
* Creates a ProgressBar, sets the current progress to 50, and prints the current progress:
|
||||
|
||||
```lua
|
||||
local basalt = require("basalt")
|
||||
|
||||
local mainFrame = basalt.createFrame()
|
||||
local aProgressbar = mainFrame:addProgressbar()
|
||||
aProgressbar:setProgress(50)
|
||||
basalt.debug(aProgressbar:getProgress())
|
||||
```
|
||||
local progressBar = mainFrame:addProgressBar()
|
||||
:setPosition(3, 3)
|
||||
:setSize(20, 3)
|
||||
:setProgress(50)
|
||||
|
||||
local currentProgress = progressBar:getProgress()
|
||||
basalt.debug("Current progress:", currentProgress)
|
||||
```
|
||||
|
||||
In this example, a ProgressBar object is created and added to the mainFrame. The setPosition and setSize methods are used to adjust the position and size of the ProgressBar. The setProgress method is used to set the current progress to 50. Finally, the getProgress method is used to retrieve the current progress value, which is then printed to the console.
|
||||
|
||||
@@ -1,19 +1,35 @@
|
||||
# onDone
|
||||
## onDone
|
||||
|
||||
`onDone(self, err)`<br>
|
||||
This is a custom event which gets triggered as soon as the progress is done.
|
||||
### Description
|
||||
|
||||
Here is a example on how to add a onDone event to your progressbar:
|
||||
`onDone(self)`
|
||||
|
||||
This is a custom event that gets triggered when the progress is complete.
|
||||
|
||||
### Returns
|
||||
|
||||
1. `object` The object in use
|
||||
|
||||
### Usage
|
||||
|
||||
* Add an onDone event to a ProgressBar:
|
||||
|
||||
```lua
|
||||
local basalt = require("basalt")
|
||||
|
||||
local main = basalt.createFrame()
|
||||
local aProgressbar = main:addProgressbar()
|
||||
local progressBar = main:addProgressBar()
|
||||
:setPosition(3, 3)
|
||||
:setSize(20, 3)
|
||||
:setProgress(50)
|
||||
|
||||
local function onProgressDone()
|
||||
basalt.debug("Progress is done")
|
||||
end
|
||||
|
||||
aProgressbar:onDone(onProgressDone)
|
||||
progressBar:onDone(onProgressDone)
|
||||
|
||||
basalt.autoUpdate()
|
||||
```
|
||||
|
||||
In this example, a ProgressBar object is created and added to the mainFrame. The setPosition and setSize methods are used to adjust the position and size of the ProgressBar. The setProgress method is used to set the current progress to 50. The onDone method is used to add a custom event that gets triggered when the progress is complete. The custom function, onProgressDone, prints a debug message to the console.
|
||||
@@ -1,19 +1,35 @@
|
||||
## setBackgroundSymbol
|
||||
|
||||
### Description
|
||||
|
||||
This will change the background symbol (default is " " - space)
|
||||
|
||||
#### Parameters:
|
||||
### Parameters
|
||||
|
||||
1. `char` the background symbol
|
||||
|
||||
#### Returns:
|
||||
### Returns
|
||||
|
||||
1. `object` The object in use
|
||||
|
||||
#### Usage:
|
||||
* Creates a progressbar and sets the progressbar background symbol to X
|
||||
### Usage
|
||||
|
||||
* Creates a ProgressBar and sets the ProgressBar background symbol to X:
|
||||
|
||||
```lua
|
||||
local basalt = require("basalt")
|
||||
|
||||
local mainFrame = basalt.createFrame()
|
||||
local aProgressbar = mainFrame:addProgressbar()
|
||||
aProgressbar:setBackgroundSymbol("X")
|
||||
local progressBar = mainFrame:addProgressBar()
|
||||
:setPosition(3, 3)
|
||||
:setSize(20, 3)
|
||||
:setBackgroundSymbol("X")
|
||||
|
||||
basalt.autoUpdate()
|
||||
```
|
||||
|
||||
In this example, a ProgressBar object is created and added to the mainFrame. The setPosition and setSize methods are used to adjust the position and size of the ProgressBar. The setBackgroundSymbol method is used to change the background symbol to "X".
|
||||
|
||||
```xml
|
||||
<progressbar backgroundSymbol="X" />
|
||||
```
|
||||
```
|
||||
|
||||
@@ -1,19 +1,29 @@
|
||||
## setDirection
|
||||
Sets the direction in which the bar should be expanding.
|
||||
|
||||
#### Parameters:
|
||||
1. `number` x direction (0 = left to right, 1 = top to bottom, 2 = right to left and 3 = bottom to top)
|
||||
### Description
|
||||
|
||||
Sets the direction in which the ProgressBar should expand.
|
||||
|
||||
### Parameters
|
||||
|
||||
1. `number` The direction of expansion (0 = left to right, 1 = top to bottom, 2 = right to left, and 3 = bottom to top)
|
||||
|
||||
### Returns
|
||||
|
||||
#### Returns:
|
||||
1. `object` The object in use
|
||||
|
||||
#### Usage:
|
||||
### Usage
|
||||
|
||||
* Creates a progressbar and sets the direction from bottom to top
|
||||
|
||||
```lua
|
||||
local mainFrame = basalt.createFrame()
|
||||
local aProgressbar = mainFrame:addProgressbar()
|
||||
aProgressbar:setDirection(3)
|
||||
```
|
||||
|
||||
In this example, a ProgressBar object is created and added to the mainFrame. The setPosition and setSize methods are used to adjust the position and size of the ProgressBar. The setProgress method is used to set the current progress to 50. The setDirection method is used to set the direction of expansion from bottom to top.
|
||||
|
||||
```xml
|
||||
<frame direction="3"></frame>
|
||||
```
|
||||
```
|
||||
|
||||
@@ -1,16 +1,31 @@
|
||||
## setProgress
|
||||
This is the function you need to call if you want the progression to change.
|
||||
|
||||
#### Parameters:
|
||||
### Description
|
||||
|
||||
This is the function you need to call if you want to change the progress of a ProgressBar.
|
||||
|
||||
### Parameters
|
||||
|
||||
1. `number` a number from 0 to 100
|
||||
|
||||
#### Returns:
|
||||
### Returns
|
||||
|
||||
1. `object` The object in use
|
||||
|
||||
#### Usage:
|
||||
* Creates a progressbar and sets the current progress to 50
|
||||
### Usage
|
||||
|
||||
* Creates a ProgressBar and sets the current progress to 50:
|
||||
|
||||
```lua
|
||||
local basalt = require("basalt")
|
||||
|
||||
local mainFrame = basalt.createFrame()
|
||||
local aProgressbar = mainFrame:addProgressbar()
|
||||
aProgressbar:setProgress(50)
|
||||
```
|
||||
local progressBar = mainFrame:addProgressBar()
|
||||
:setPosition(3, 3)
|
||||
:setSize(20, 3)
|
||||
:setProgress(50)
|
||||
|
||||
basalt.autoUpdate()
|
||||
```
|
||||
|
||||
In this example, a ProgressBar object is created and added to the mainFrame. The setPosition and setSize methods are used to adjust the position and size of the ProgressBar. The setProgress method is used to set the current progress to 50.
|
||||
|
||||
@@ -1,21 +1,38 @@
|
||||
## setProgressBar
|
||||
|
||||
### Description
|
||||
|
||||
This function will change the visual display of your progress bar
|
||||
|
||||
#### Parameters:
|
||||
### Parameters
|
||||
|
||||
1. `number|color` the expanding progress bar color
|
||||
2. `char` optional - the bar symbol - default is " " (space)
|
||||
3. `number|color` optional - the bar symbol color
|
||||
|
||||
#### Returns:
|
||||
### Returns
|
||||
|
||||
1. `object` The object in use
|
||||
|
||||
#### Usage:
|
||||
* Creates a progressbar and sets the progressbar color to green
|
||||
### Usage
|
||||
|
||||
* Creates a ProgressBar and sets the ProgressBar color to green, the symbol to "-", and the symbol color to yellow:
|
||||
|
||||
```lua
|
||||
local basalt = require("basalt")
|
||||
|
||||
local mainFrame = basalt.createFrame()
|
||||
local aProgressbar = mainFrame:addProgressbar()
|
||||
aProgressbar:setProgressBar(colors.green, colors.yellow, colors.red)
|
||||
local progressBar = mainFrame:addProgressBar()
|
||||
:setPosition(3, 3)
|
||||
:setSize(20, 3)
|
||||
:setProgress(50)
|
||||
:setProgressBar(colors.green, "-", colors.yellow)
|
||||
|
||||
basalt.autoUpdate()
|
||||
```
|
||||
|
||||
In this example, a ProgressBar object is created and added to the mainFrame. The setPosition, setSize, and setProgress methods are used to adjust the position, size, and progress of the ProgressBar. The setProgressBar method is used to change the progress bar color to green, the symbol to "-", and the symbol color to yellow.
|
||||
|
||||
```xml
|
||||
<progressbar progressColor="green" progressSymbol="yellow" progressSymbolColor="red" />
|
||||
```
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user