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:
Robert Jelic
2023-04-30 17:05:34 +02:00
parent e086c1abb2
commit bb1b1beb79
341 changed files with 15541 additions and 3862 deletions

View File

@@ -1,5 +1,29 @@
## getIndex
### Description
Returns the current index
#### Returns:
### Returns
1. `number` index
### Usage
* Create a new scrollbar and get the current index:
```lua
local basalt = require("basalt")
local mainFrame = basalt.createFrame()
local scrollbar = mainFrame:addScrollbar()
:setPosition(3, 3)
:setSize(1, 10)
local index = scrollbar:getIndex()
basalt.debug("Current index: " .. index)
basalt.autoUpdate()
```
In this example, a Scrollbar object is created and added to the mainFrame. The getPosition and setSize methods are used to adjust the position and size of the Scrollbar. The getIndex method is called to retrieve the current index of the Scrollbar, and the result is printed using basalt.debug.

View File

@@ -1,18 +1,35 @@
## setBarType
Changes the scrollbar to be vertical or horizontal, default is vertical
#### Parameters:
1. `string` vertical or horizontal
### Description
Changes the scrollbar orientation between vertical and horizontal. The default orientation is vertical.
### Parameters
1. `string` The orientation you want to set for the scrollbar ("vertical" or "horizontal")
### Returns
#### Returns:
1. `object` The object in use
#### Usage:
* Creates a new scrollbar and changes the bar type to horizontal
### Usage
* Create a new scrollbar and change the bar type to horizontal:
```lua
local main = basalt.createFrame()
local scrollbar = main:addScrollbar():setBarType("horizontal")
local basalt = require("basalt")
local mainFrame = basalt.createFrame()
local scrollbar = mainFrame:addScrollbar()
:setPosition(3, 3)
:setSize(10, 1)
:setBarType("horizontal")
basalt.autoUpdate()
```
In this example, a Scrollbar object is created and added to the mainFrame. The setPosition and setSize methods are used to adjust the position and size of the Scrollbar. The setBarType method is used to set the orientation of the Scrollbar to "horizontal".
```xml
<scrollbar barType="horizontal" />
```
```

View File

@@ -1,21 +1,43 @@
## setIndex
Changes the current index to your choice, for example you could create a button which scrolls up to 1 by using :setIndex(1)
#### Parameters:
### Description
Changes the current index to your choice. For example, you could create a button that scrolls up to index 1 by using setIndex(1).
### Parameters
1. `number` the index
#### Returns:
### Returns
1. `object` The object in use
#### Usage:
* Creates a new scrollbar and changes the index to 1 as soon as the button got clicked
### Usage
* Create a new scrollbar and change the index to 1 when the button is clicked:
```lua
local main = basalt.createFrame()
local scrollbar = main:addScrollbar():setMaxValue(20)
local button = main:addButton(function()
scrollbar:setIndex(1)
end)
local basalt = require("basalt")
local mainFrame = basalt.createFrame()
local scrollbar = mainFrame:addScrollbar()
:setPosition(3, 3)
:setSize(1, 10)
:setMaxValue(20)
local button = mainFrame:addButton()
:setPosition(5, 3)
:setSize(10, 3)
:setText("Set index to 1")
:onClick(function()
scrollbar:setIndex(1)
end)
basalt.autoUpdate()
```
In this example, a Scrollbar object is created and added to the mainFrame. The setPosition and setSize methods are used to adjust the position and size of the Scrollbar. The setMaxValue method is used to set the maximum value of the Scrollbar. A Button object is also created and added to the mainFrame. The onClick method is used to add a custom event that changes the index of the Scrollbar to 1 when the button is clicked.
```xml
<scrollbar index="2" />
```
```

View File

@@ -1,18 +1,35 @@
## setMaxValue
the default max value is always the width (if horizontal) or height (if vertical), if you change the max value the bar will always calculate the value based on its width or height - example: you set the max value to 100, the height is 10 and it is a vertical bar, this means if the bar is on top, the value is 10, if the bar goes one below, it is 20 and so on.
#### Parameters:
1. `number` maximum
### Description
The default max value is always the width (if horizontal) or height (if vertical). If you change the max value, the bar will always calculate the value based on its width or height. For example, you set the max value to 100, the height is 10, and it is a vertical bar; this means if the bar is on top, the value is 10, if the bar goes one below, it is 20, and so on.
### Parameters
1. `number` The maximum value
### Returns
#### Returns:
1. `object` The object in use
#### Usage:
* Creates a new scrollbar and changes the max value to 20
### Usage
* Create a new scrollbar and change the max value to 20:
```lua
local main = basalt.createFrame()
local scrollbar = main:addScrollbar():setMaxValue(20)
local basalt = require("basalt")
local mainFrame = basalt.createFrame()
local scrollbar = mainFrame:addScrollbar()
:setPosition(3, 3)
:setSize(1, 10)
:setMaxValue(20)
basalt.autoUpdate()
```
In this example, a Scrollbar object is created and added to the mainFrame. The setPosition and setSize methods are used to adjust the position and size of the Scrollbar. The setMaxValue method is used to set the maximum value of the Scrollbar to 20.
```xml
<scrollbar maxValue="20" />
```
```

View File

@@ -1,18 +1,35 @@
## setSymbol
Changes the scrollbar symbol, default is " "
#### Parameters:
1. `string` symbol
### Description
Changes the scrollbar symbol. The default symbol is " " (space).
### Parameters
1. `string` The symbol you want to set for the scrollbar
### Returns
#### Returns:
1. `object` The object in use
#### Usage:
* Creates a new scrollbar and changes the symbol to X
### Usage
* Create a new scrollbar and change the symbol to X:
```lua
local main = basalt.createFrame()
local scrollbar = main:addScrollbar():setSymbol("X")
local basalt = require("basalt")
local mainFrame = basalt.createFrame()
local scrollbar = mainFrame:addScrollbar()
:setPosition(3, 3)
:setSize(1, 10)
:setSymbol("X")
basalt.autoUpdate()
```
In this example, a Scrollbar object is created and added to the mainFrame. The setPosition and setSize methods are used to adjust the position and size of the Scrollbar. The setSymbol method is used to set the symbol of the Scrollbar to "X".
```xml
<scrollbar symbol="X" />
```
```