Docs: basalt.get(Active)Frame
This commit is contained in:
@@ -1,12 +1,17 @@
|
|||||||
## basalt.getActiveFrame
|
|
||||||
Returns the currently active/visible base frame
|
|
||||||
|
|
||||||
#### Returns:
|
# basalt.getActiveFrame
|
||||||
|
|
||||||
|
Returns the currently active/visible base frame.
|
||||||
|
|
||||||
|
## Returns
|
||||||
|
|
||||||
1. `frame` The current frame
|
1. `frame` The current frame
|
||||||
|
|
||||||
#### Usage:
|
## Usage
|
||||||
|
|
||||||
* Displays the active frame name in the debug console
|
* Displays the active frame name in the debug console
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
local main = basalt.createFrame()
|
local main = basalt.createFrame()
|
||||||
basalt.debug(basalt.getActiveFrame():getName()) -- returns the id
|
basalt.debug(basalt.getActiveFrame():getName()) -- returns the id
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -1,14 +1,20 @@
|
|||||||
## basalt.getFrame
|
|
||||||
Returns a base frame by the given id
|
|
||||||
|
|
||||||
#### Parameters:
|
# basalt.getFrame
|
||||||
|
|
||||||
|
Returns a base frame by the given id.
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
1. `string` id
|
1. `string` id
|
||||||
|
|
||||||
#### Returns:
|
## Returns
|
||||||
1. `frame` object
|
|
||||||
|
1. `frame` The frame with the supplied id.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
#### Usage:
|
|
||||||
* Creates, fetches and shows the "myFirstFrame" object
|
* Creates, fetches and shows the "myFirstFrame" object
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
local main = basalt.createFrame("firstBaseFrame")
|
local main = basalt.createFrame("firstBaseFrame")
|
||||||
local main2 = basalt.createFrame("secondBaseFrame")
|
local main2 = basalt.createFrame("secondBaseFrame")
|
||||||
@@ -16,8 +22,9 @@ main:addButton()
|
|||||||
:setText("Show")
|
:setText("Show")
|
||||||
:onClick(function()
|
:onClick(function()
|
||||||
local frame2 = basalt.getFrame("secondBaseFrame")
|
local frame2 = basalt.getFrame("secondBaseFrame")
|
||||||
if(frame2~=nil)then
|
if(frame2 ~= nil)then
|
||||||
frame2:show()
|
frame2:show()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
```
|
basalt.autoUpdate()
|
||||||
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user