From 8832929c1eb1a2beabacb4030390a784609a6476 Mon Sep 17 00:00:00 2001 From: Robert Jelic <36573031+NoryiE@users.noreply.github.com> Date: Sat, 2 Apr 2022 15:12:16 +0200 Subject: [PATCH] Updated Scrollbar (markdown) --- Scrollbar.md | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/Scrollbar.md b/Scrollbar.md index 6d3f665..8209b85 100644 --- a/Scrollbar.md +++ b/Scrollbar.md @@ -1 +1,41 @@ -WIP \ No newline at end of file +Scrollbars are objects, the user can scroll vertically or horizontally, this can change the value.
+Here is a example of how to create a standard scrollbar: + +````lua +local mainFrame = NyoUI.createFrame("myFirstFrame"):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 the 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): + +## setSymbol +Changes the symbol + +````lua +local mainFrame = NyoUI.createFrame("myFirstFrame"):show() +local aScrollbar = mainFrame:addScrollbar("myFirstScrollbar"):setSymbol("X"):show() +```` +**args:** char
+**returns:** the object
+ +## setSymbolColor +Changes the symbol color + +````lua +local mainFrame = NyoUI.createFrame("myFirstFrame"):show() +local aScrollbar = mainFrame:addScrollbar("myFirstScrollbar"):setSymbol("X"):setSymbolColor(colors.green):show() +```` +**args:** color
+**returns:** the object
+ +## setBarType +If the bar goes vertically or horizontally + +````lua +local mainFrame = NyoUI.createFrame("myFirstFrame"):show() +local aScrollbar = mainFrame:addScrollbar("myFirstScrollbar"):setBarType("horizontal"):show() +```` +**args:** "vertical" or "horizontal"
+**returns:** the object