From ae790f0ba97f699e4a041aef04add0459a6cf04e Mon Sep 17 00:00:00 2001 From: Robert Jelic <36573031+NoryiE@users.noreply.github.com> Date: Mon, 2 May 2022 18:04:05 +0200 Subject: [PATCH] Updated Frame (markdown) --- Frame.md | 41 +++++++++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/Frame.md b/Frame.md index 3b1a62c..ee5d4cb 100644 --- a/Frame.md +++ b/Frame.md @@ -2,7 +2,7 @@ Frame function list: -# basalt.createFrame +## basalt.createFrame creates a new non-parent frame - in most cases the first thing you need. ````lua local mainFrame = basalt.createFrame("myFirstFrame") @@ -10,7 +10,7 @@ local mainFrame = basalt.createFrame("myFirstFrame") **args:** string name (should be unique)
**returns:** new frame object
-# addFrame +## addFrame The same as basalt.createFrame, but it will have a parent frame ````lua frame:addFrame("myFirstFrame") @@ -22,7 +22,7 @@ Example: local mainFrame = basalt.createFrame("myFirstFrame") local aFrame = mainFrame:addFrame("myFirstSubFrame") ```` -# setBar +## setBar Changes the frame bar ````lua frame:setBar("My first Frame!", colors.gray, colors.lightGray) @@ -41,7 +41,7 @@ local mainFrame = basalt.createFrame("myFirstFrame") local aFrame = mainFrame:addFrame("myFirstSubFrame"):setBar("My first Frame!") ```` -# setBarTextAlign +## setBarTextAlign Sets the bar text alignment ````lua local mainFrame = basalt.createFrame("myFirstFrame"):setBar("My first Frame!"):setBarTextAlign("right") @@ -51,7 +51,7 @@ local mainFrame = basalt.createFrame("myFirstFrame"):setBar("My first Frame!"):s -# showBar +## showBar shows/hides the bar on top where you will see the title if its active ````lua local mainFrame = basalt.createFrame("myFirstFrame")setBar("Hello World!"):showBar() @@ -59,7 +59,7 @@ local mainFrame = basalt.createFrame("myFirstFrame")setBar("Hello World!"):showB **args:** bool visible (no args = true)
**returns:** self
-# isModifierActive +## isModifierActive returns true if user is currently holding a key down ````lua local mainFrame = basalt.createFrame("myFirstFrame"):isModifierActive("shift") @@ -79,7 +79,7 @@ else end) ```` -# getObject +## getObject returns a children object ````lua local mainFrame = basalt.createFrame("myFirstFrame") @@ -89,7 +89,7 @@ local aButton = mainFrame:getObject("myFirstButton") **args:** string name (has to be a children)
**returns:** any object
-# removeObject +## removeObject removes the object ````lua local mainFrame = basalt.createFrame("myFirstFrame") @@ -99,7 +99,7 @@ mainFrame:removeObject("myFirstButton") **args:** string name (has to be a children)
**returns:** any object
-# setFocusedObject +## setFocusedObject changes the currently focused object ````lua local mainFrame = basalt.createFrame("myFirstFrame") @@ -108,7 +108,7 @@ mainFrame:setFocusedObject(aButton) ```` **args:** any object (has to be a children)
**returns:** self
-# removeFocusedObject +## removeFocusedObject removes the focus of the currently focused object ````lua local mainFrame = basalt.createFrame("myFirstFrame") @@ -118,7 +118,7 @@ mainFrame:removeFocusedObject(aButton) **args:** any object (has to be a children)
**returns:** self
-# getFocusedObject +## getFocusedObject gets the currently focused object ````lua local mainFrame = basalt.createFrame("myFirstFrame") @@ -128,7 +128,7 @@ local focusedObject = mainFrame:getFocusedObject() **args:** -
**returns:** object
-# setMoveable +## setMoveable sets if the frame should be moveable or not (to move the frame you need to drag it on the top bar) ````lua @@ -136,3 +136,20 @@ local mainFrame = basalt.createFrame("myFirstFrame"):setMoveable(true) ```` **args:** bool moveable
**returns:** self
+ +## setOffset +sets the frame's coordinate offset, they will get added to their children objects. For example, if you use the scrollbar and you use its value to add a offset to a frame, you will get a scrollable frame. +objects are also able to ignore the offset by using :ignoreOffset() (maybe your scrollbar if its a children of the frame should ignore offset) + +````lua +local mainFrame = basalt.createFrame("myFirstFrame"):setOffset(5, 3) +```` +**args:** number x, number y (offset in x direction and offset in y direction, also doesn't matter if its a negative value or positive
+**returns:** self
+ + +````lua +local mainFrame = basalt.createFrame("myFirstFrame"):setOffset(5, 3) +```` +**args:** number x, number y (offset in x direction and offset in y direction, also doesn't matter if its a negative value or positive
+**returns:** self