updated Frame.md
41
Frame.md
41
Frame.md
@@ -1,13 +1,17 @@
|
||||
<a href="https://i.imgur.com/aikc0K1.png"><img src="https://i.imgur.com/aikc0K1.png" height="500" /></a>
|
||||
|
||||
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)<br>
|
||||
**Parameters:** <br>
|
||||
1. string name (should be unique)<br>
|
||||
**returns:** new frame object<br>
|
||||
|
||||
## 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)<br>
|
||||
**Parameters:** string name (should be unique)<br>
|
||||
**returns:** new frame object<br>
|
||||
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<br>
|
||||
**Parameters:** string text, number bgcolor, number fgcolor<br>
|
||||
**returns:** self<br>
|
||||
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"))<br>
|
||||
**Parameters:** string value - ("left", "center", "right"))<br>
|
||||
**returns:** self<br>
|
||||
|
||||
|
||||
@@ -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)<br>
|
||||
**Parameters:** bool visible (no Parameters = true)<br>
|
||||
**returns:** self<br>
|
||||
|
||||
## 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"<br>
|
||||
**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"<br>
|
||||
**returns:** boolean - if the user is holding the key down<br>
|
||||
|
||||
**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)<br>
|
||||
**Parameters:** string name (has to be a children)<br>
|
||||
**returns:** any object<br>
|
||||
|
||||
## removeObject
|
||||
@@ -96,7 +100,7 @@ local mainFrame = basalt.createFrame("myFirstFrame")
|
||||
mainFrame:addButton("myFirstButton")
|
||||
mainFrame:removeObject("myFirstButton")
|
||||
````
|
||||
**args:** string name (has to be a children)<br>
|
||||
**Parameters:** string name (has to be a children)<br>
|
||||
**returns:** any object<br>
|
||||
|
||||
## 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)<br>
|
||||
**Parameters:** any object (has to be a children)<br>
|
||||
**returns:** self<br>
|
||||
## 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)<br>
|
||||
**Parameters:** any object (has to be a children)<br>
|
||||
**returns:** self<br>
|
||||
|
||||
## getFocusedObject
|
||||
@@ -125,16 +129,21 @@ local mainFrame = basalt.createFrame("myFirstFrame")
|
||||
local aButton = mainFrame:addButton("myFirstButton")
|
||||
local focusedObject = mainFrame:getFocusedObject()
|
||||
````
|
||||
**args:** -<br>
|
||||
**Parameters:** -<br>
|
||||
**returns:** object<br>
|
||||
|
||||
## 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<br>
|
||||
**Parameters:** bool moveable<br>
|
||||
**returns:** self<br>
|
||||
|
||||
## 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<br>
|
||||
**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<br>
|
||||
**returns:** self<br>
|
||||
|
||||
Reference in New Issue
Block a user