Updated Scrollbar (markdown)
34
Scrollbar.md
34
Scrollbar.md
@@ -2,50 +2,50 @@ Scrollbars are objects, the user can scroll vertically or horizontally, this can
|
|||||||
Here is a example of how to create a standard scrollbar:
|
Here is a example of how to create a standard scrollbar:
|
||||||
|
|
||||||
````lua
|
````lua
|
||||||
local mainFrame = NyoUI.createFrame("myFirstFrame"):show()
|
local mainFrame = basalt.createFrame("myFirstFrame"):show()
|
||||||
local aScrollbar = mainFrame:addScrollbar("myFirstScrollbar"):show()
|
local aScrollbar = mainFrame:addScrollbar("myFirstScrollbar"):show()
|
||||||
````
|
````
|
||||||
|
|
||||||
This will create a default label with a size 5 width and 1 height on position 1 1 (relative to its parent frame), the default background is colors.gray, the default text color is colors.black. the default bar type is vertical, the default symbol is " " and the default symbol color is colors.lightGray. The default zIndex is 5.
|
This will create a default label with a size 5 width and 1 height on position 1 1 (relative to its parent frame), the default background is colors.gray, the default text color is colors.black. the default bar type is vertical, the default symbol is " " and the default symbol color is colors.lightGray. The default zIndex is 5.
|
||||||
|
|
||||||
Here are all possible functions available for scrollbars. Remember scrollbar inherit from [object](https://github.com/NoryiE/NyoUI/wiki/Object):
|
Here are all possible functions available for scrollbars. Remember scrollbar inherit from [object](https://github.com/NoryiE/Basalt/wiki/Object):
|
||||||
|
|
||||||
## setSymbol
|
## setSymbol
|
||||||
Changes the symbol
|
Changes the symbol
|
||||||
|
|
||||||
````lua
|
````lua
|
||||||
local mainFrame = NyoUI.createFrame("myFirstFrame"):show()
|
local mainFrame = basalt.createFrame("myFirstFrame"):show()
|
||||||
local aScrollbar = mainFrame:addScrollbar("myFirstScrollbar"):setSymbol("X"):show()
|
local aScrollbar = mainFrame:addScrollbar("myFirstScrollbar"):setSymbol("X"):show()
|
||||||
````
|
````
|
||||||
**args:** char<br>
|
**parameters:** char symbol<br>
|
||||||
**returns:** the object<br>
|
**returns:** self<br>
|
||||||
|
|
||||||
## setSymbolColor
|
## setBackgroundSymbol
|
||||||
Changes the symbol color
|
Changes the background symbol color
|
||||||
|
|
||||||
````lua
|
````lua
|
||||||
local mainFrame = NyoUI.createFrame("myFirstFrame"):show()
|
local mainFrame = basalt.createFrame("myFirstFrame"):show()
|
||||||
local aScrollbar = mainFrame:addScrollbar("myFirstScrollbar"):setSymbol("X"):setSymbolColor(colors.green):show()
|
local aScrollbar = mainFrame:addScrollbar("myFirstScrollbar"):setSymbol("X"):setBackgroundSymbol(colors.green):show()
|
||||||
````
|
````
|
||||||
**args:** color<br>
|
**parameters:** number symbolcolor<br>
|
||||||
**returns:** the object<br>
|
**returns:** self<br>
|
||||||
|
|
||||||
## setBarType
|
## setBarType
|
||||||
If the bar goes vertically or horizontally
|
If the bar goes vertically or horizontally
|
||||||
|
|
||||||
````lua
|
````lua
|
||||||
local mainFrame = NyoUI.createFrame("myFirstFrame"):show()
|
local mainFrame = basalt.createFrame("myFirstFrame"):show()
|
||||||
local aScrollbar = mainFrame:addScrollbar("myFirstScrollbar"):setBarType("horizontal"):show()
|
local aScrollbar = mainFrame:addScrollbar("myFirstScrollbar"):setBarType("horizontal"):show()
|
||||||
````
|
````
|
||||||
**args:** "vertical" or "horizontal"<br>
|
**parameters:** string value ("vertical" or "horizontal")<br>
|
||||||
**returns:** the object<br>
|
**returns:** self<br>
|
||||||
|
|
||||||
## setMaxValue
|
## setMaxValue
|
||||||
the default max value is always the width (if vertical) or height (if horizontal), if you change the max value the bar will always calculate the value based of his 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.
|
the default max value is always the width (if vertical) or height (if horizontal), if you change the max value the bar will always calculate the value based of his 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.
|
||||||
|
|
||||||
````lua
|
````lua
|
||||||
local mainFrame = NyoUI.createFrame("myFirstFrame"):show()
|
local mainFrame = basalt.createFrame("myFirstFrame"):show()
|
||||||
local aScrollbar = mainFrame:addScrollbar("myFirstScrollbar"):setMaxValue(123):show()
|
local aScrollbar = mainFrame:addScrollbar("myFirstScrollbar"):setMaxValue(123):show()
|
||||||
````
|
````
|
||||||
**args:** any number<br>
|
**parameters:** any number<br>
|
||||||
**returns:** the object<br>
|
**returns:** self<br>
|
||||||
|
|||||||
Reference in New Issue
Block a user