From 183a25ee76364ae9d0919f103c0c9dd1ace867d1 Mon Sep 17 00:00:00 2001 From: Samkist Date: Thu, 19 May 2022 16:17:00 -0400 Subject: [PATCH] updated Frame.md --- Frame.md | 41 +++++++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/Frame.md b/Frame.md index 121d97c..f12da1d 100644 --- a/Frame.md +++ b/Frame.md @@ -1,13 +1,17 @@ -Frames are like containers, but are also normal objects. Means, you can add other objects (even frames) to a frame and if the frame itself is visible, all sub objects (if they are set to visible by :show()) are also visible. A better description will follow. +Frames are like containers, but are also normal objects. +In other words, you can add other objects _(even frames)_ to a frame; if the frame itself is visible +all sub-objects _(if they are set as visible)_ are also visible. A better description will follow. ## basalt.createFrame -creates a new non-parent frame - in most cases the first thing you need. +Creates a new non-parent frame - in most cases it is the first thing you need. + ````lua -local mainFrame = basalt.createFrame("myFirstFrame") +local myFirstFrame = basalt.createFrame("myFirstFrame") ```` -**args:** string name (should be unique)
+**Parameters:**
+1. string name (should be unique)
**returns:** new frame object
## addFrame @@ -15,7 +19,7 @@ The same as basalt.createFrame, but it will have a parent frame ````lua frame:addFrame("myFirstFrame") ```` -**args:** string name (should be unique)
+**Parameters:** string name (should be unique)
**returns:** new frame object
Example: ````lua @@ -27,7 +31,7 @@ Changes the frame bar ````lua frame:setBar("My first Frame!", colors.gray, colors.lightGray) ```` -**args:** string text, number bgcolor, number fgcolor
+**Parameters:** string text, number bgcolor, number fgcolor
**returns:** self
Example: ````lua @@ -46,7 +50,7 @@ Sets the bar text alignment ````lua local mainFrame = basalt.createFrame("myFirstFrame"):setBar("My first Frame!"):setBarTextAlign("right") ```` -**args:** string value - ("left", "center", "right"))
+**Parameters:** string value - ("left", "center", "right"))
**returns:** self
@@ -56,7 +60,7 @@ 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() ```` -**args:** bool visible (no args = true)
+**Parameters:** bool visible (no Parameters = true)
**returns:** self
## isModifierActive -- DISABLED this function will work very soon @@ -64,7 +68,7 @@ returns true if user is currently holding a key down ````lua local mainFrame = basalt.createFrame("myFirstFrame"):isModifierActive("shift") ```` -**args:** int or string - int can be any os.queueEvent("key") key, or instead of int you can use the following strings: "shift", "ctrl", "alt"
+**Parameters:** int or string - int can be any os.queueEvent("key") key, or instead of int you can use the following strings: "shift", "ctrl", "alt"
**returns:** boolean - if the user is holding the key down
**Example:** @@ -86,7 +90,7 @@ local mainFrame = basalt.createFrame("myFirstFrame") mainFrame:addButton("myFirstButton") local aButton = mainFrame:getObject("myFirstButton") ```` -**args:** string name (has to be a children)
+**Parameters:** string name (has to be a children)
**returns:** any object
## removeObject @@ -96,7 +100,7 @@ local mainFrame = basalt.createFrame("myFirstFrame") mainFrame:addButton("myFirstButton") mainFrame:removeObject("myFirstButton") ```` -**args:** string name (has to be a children)
+**Parameters:** string name (has to be a children)
**returns:** any object
## setFocusedObject @@ -106,7 +110,7 @@ local mainFrame = basalt.createFrame("myFirstFrame") local aButton = mainFrame:addButton("myFirstButton") mainFrame:setFocusedObject(aButton) ```` -**args:** any object (has to be a children)
+**Parameters:** any object (has to be a children)
**returns:** self
## removeFocusedObject removes the focus of the currently focused object @@ -115,7 +119,7 @@ local mainFrame = basalt.createFrame("myFirstFrame") local aButton = mainFrame:addButton("myFirstButton") mainFrame:removeFocusedObject(aButton) ```` -**args:** any object (has to be a children)
+**Parameters:** any object (has to be a children)
**returns:** self
## getFocusedObject @@ -125,16 +129,21 @@ local mainFrame = basalt.createFrame("myFirstFrame") local aButton = mainFrame:addButton("myFirstButton") local focusedObject = mainFrame:getFocusedObject() ```` -**args:** -
+**Parameters:** -
**returns:** object
+## setMovable + + ## setMoveable +##### _Deprecated in favor of setMovable_ + sets if the frame should be moveable or not (to move the frame you need to drag it on the top bar) ````lua local mainFrame = basalt.createFrame("myFirstFrame"):setMoveable(true) ```` -**args:** bool moveable
+**Parameters:** bool moveable
**returns:** self
## setOffset @@ -144,5 +153,5 @@ objects are also able to ignore the offset by using :ignoreOffset() (maybe your ````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
+**Parameters:** 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