Updated Frame (markdown)
41
Frame.md
41
Frame.md
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Frame function list:
|
Frame function list:
|
||||||
|
|
||||||
# basalt.createFrame
|
## 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 the first thing you need.
|
||||||
````lua
|
````lua
|
||||||
local mainFrame = basalt.createFrame("myFirstFrame")
|
local mainFrame = basalt.createFrame("myFirstFrame")
|
||||||
@@ -10,7 +10,7 @@ local mainFrame = basalt.createFrame("myFirstFrame")
|
|||||||
**args:** string name (should be unique)<br>
|
**args:** string name (should be unique)<br>
|
||||||
**returns:** new frame object<br>
|
**returns:** new frame object<br>
|
||||||
|
|
||||||
# addFrame
|
## addFrame
|
||||||
The same as basalt.createFrame, but it will have a parent frame
|
The same as basalt.createFrame, but it will have a parent frame
|
||||||
````lua
|
````lua
|
||||||
frame:addFrame("myFirstFrame")
|
frame:addFrame("myFirstFrame")
|
||||||
@@ -22,7 +22,7 @@ Example:
|
|||||||
local mainFrame = basalt.createFrame("myFirstFrame")
|
local mainFrame = basalt.createFrame("myFirstFrame")
|
||||||
local aFrame = mainFrame:addFrame("myFirstSubFrame")
|
local aFrame = mainFrame:addFrame("myFirstSubFrame")
|
||||||
````
|
````
|
||||||
# setBar
|
## setBar
|
||||||
Changes the frame bar
|
Changes the frame bar
|
||||||
````lua
|
````lua
|
||||||
frame:setBar("My first Frame!", colors.gray, colors.lightGray)
|
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!")
|
local aFrame = mainFrame:addFrame("myFirstSubFrame"):setBar("My first Frame!")
|
||||||
````
|
````
|
||||||
|
|
||||||
# setBarTextAlign
|
## setBarTextAlign
|
||||||
Sets the bar text alignment
|
Sets the bar text alignment
|
||||||
````lua
|
````lua
|
||||||
local mainFrame = basalt.createFrame("myFirstFrame"):setBar("My first Frame!"):setBarTextAlign("right")
|
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
|
shows/hides the bar on top where you will see the title if its active
|
||||||
````lua
|
````lua
|
||||||
local mainFrame = basalt.createFrame("myFirstFrame")setBar("Hello World!"):showBar()
|
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)<br>
|
**args:** bool visible (no args = true)<br>
|
||||||
**returns:** self<br>
|
**returns:** self<br>
|
||||||
|
|
||||||
# isModifierActive
|
## isModifierActive
|
||||||
returns true if user is currently holding a key down
|
returns true if user is currently holding a key down
|
||||||
````lua
|
````lua
|
||||||
local mainFrame = basalt.createFrame("myFirstFrame"):isModifierActive("shift")
|
local mainFrame = basalt.createFrame("myFirstFrame"):isModifierActive("shift")
|
||||||
@@ -79,7 +79,7 @@ else
|
|||||||
end)
|
end)
|
||||||
````
|
````
|
||||||
|
|
||||||
# getObject
|
## getObject
|
||||||
returns a children object
|
returns a children object
|
||||||
````lua
|
````lua
|
||||||
local mainFrame = basalt.createFrame("myFirstFrame")
|
local mainFrame = basalt.createFrame("myFirstFrame")
|
||||||
@@ -89,7 +89,7 @@ local aButton = mainFrame:getObject("myFirstButton")
|
|||||||
**args:** string name (has to be a children)<br>
|
**args:** string name (has to be a children)<br>
|
||||||
**returns:** any object<br>
|
**returns:** any object<br>
|
||||||
|
|
||||||
# removeObject
|
## removeObject
|
||||||
removes the object
|
removes the object
|
||||||
````lua
|
````lua
|
||||||
local mainFrame = basalt.createFrame("myFirstFrame")
|
local mainFrame = basalt.createFrame("myFirstFrame")
|
||||||
@@ -99,7 +99,7 @@ mainFrame:removeObject("myFirstButton")
|
|||||||
**args:** string name (has to be a children)<br>
|
**args:** string name (has to be a children)<br>
|
||||||
**returns:** any object<br>
|
**returns:** any object<br>
|
||||||
|
|
||||||
# setFocusedObject
|
## setFocusedObject
|
||||||
changes the currently focused object
|
changes the currently focused object
|
||||||
````lua
|
````lua
|
||||||
local mainFrame = basalt.createFrame("myFirstFrame")
|
local mainFrame = basalt.createFrame("myFirstFrame")
|
||||||
@@ -108,7 +108,7 @@ mainFrame:setFocusedObject(aButton)
|
|||||||
````
|
````
|
||||||
**args:** any object (has to be a children)<br>
|
**args:** any object (has to be a children)<br>
|
||||||
**returns:** self<br>
|
**returns:** self<br>
|
||||||
# removeFocusedObject
|
## removeFocusedObject
|
||||||
removes the focus of the currently focused object
|
removes the focus of the currently focused object
|
||||||
````lua
|
````lua
|
||||||
local mainFrame = basalt.createFrame("myFirstFrame")
|
local mainFrame = basalt.createFrame("myFirstFrame")
|
||||||
@@ -118,7 +118,7 @@ mainFrame:removeFocusedObject(aButton)
|
|||||||
**args:** any object (has to be a children)<br>
|
**args:** any object (has to be a children)<br>
|
||||||
**returns:** self<br>
|
**returns:** self<br>
|
||||||
|
|
||||||
# getFocusedObject
|
## getFocusedObject
|
||||||
gets the currently focused object
|
gets the currently focused object
|
||||||
````lua
|
````lua
|
||||||
local mainFrame = basalt.createFrame("myFirstFrame")
|
local mainFrame = basalt.createFrame("myFirstFrame")
|
||||||
@@ -128,7 +128,7 @@ local focusedObject = mainFrame:getFocusedObject()
|
|||||||
**args:** -<br>
|
**args:** -<br>
|
||||||
**returns:** object<br>
|
**returns:** object<br>
|
||||||
|
|
||||||
# setMoveable
|
## setMoveable
|
||||||
sets if the frame should be moveable or not (to move the frame you need to drag it on the top bar)
|
sets if the frame should be moveable or not (to move the frame you need to drag it on the top bar)
|
||||||
|
|
||||||
````lua
|
````lua
|
||||||
@@ -136,3 +136,20 @@ local mainFrame = basalt.createFrame("myFirstFrame"):setMoveable(true)
|
|||||||
````
|
````
|
||||||
**args:** bool moveable<br>
|
**args:** bool moveable<br>
|
||||||
**returns:** self<br>
|
**returns:** self<br>
|
||||||
|
|
||||||
|
## 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<br>
|
||||||
|
**returns:** self<br>
|
||||||
|
|
||||||
|
|
||||||
|
````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>
|
||||||
|
**returns:** self<br>
|
||||||
|
|||||||
Reference in New Issue
Block a user