Skip to content

Commit 71e8870

Browse files
authored
Update Frame.md
1 parent 1198a5b commit 71e8870

1 file changed

Lines changed: 14 additions & 77 deletions

File tree

docs/objects/Frame.md

Lines changed: 14 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -39,28 +39,29 @@ local myFrame = mainFrame:addFrame("myFirstSubFrame")
3939
Sets the text, background, and foreground of the upper bar of the frame, accordingly.
4040

4141
#### Parameters:
42-
1. `string` The text to set the bar to
42+
1. `string` The title text to set the bar to
4343
2. `number` The background color
4444
2. `number` The foreground color
4545

4646
#### Returns:
4747
1. `frame` The frame being used
4848

4949
#### Usage:
50-
* Set the title to "My first frame!", with a background of gray and a foreground of light gray.
50+
* Set the title to "My first frame!", with a background of black and a foreground of light gray.
5151
```lua
52-
frame:setBar("My first Frame!", colors.gray, colors.lightGray)
52+
frame:setBar("My first Frame!", colors.black, colors.lightGray)
5353
```
5454
* Store the frame, use the named frame variable after assigning.
5555
```lua
56-
local mainFrame = basalt.createFrame("myFirstFrame")
56+
local mainFrame = basalt.createFrame("myFirstFrame"):show()
5757
local myFrame = MainFrame:addFrame("myFirstSubFrame")
5858
myFrame:setBar("My first Frame!")
59+
myFrame:show()
5960
```
6061
* This abuses the call-chaining that Basalt uses.
6162
```lua
62-
local mainFrame = basalt.createFrame("myFirstFrame")
63-
local myFrame = mainFrame:addFrame("myFirstSubFrame"):setBar("My first Frame!")
63+
local mainFrame = basalt.createFrame("myFirstFrame"):show()
64+
local myFrame = mainFrame:addFrame("myFirstSubFrame"):setBar("My first Frame!"):show()
6465
```
6566

6667
## setBarTextAlign
@@ -93,70 +94,22 @@ Toggles the frame's upper bar
9394
local mainFrame = myFrame:setBar("Hello World!"):showBar()
9495
```
9596

96-
## addMonitor
97-
adds a monitor to the active main frame.
97+
## setMonitor
98+
Sets this frame as a monitor frame
9899

99100
#### Parameters:
100101
1. `string` The monitor name ("right", "left",... "monitor_1", "monitor_2",...)
101102

102103
#### Returns:
103-
1. `frame` returns a frame which you can use like normal frames
104-
105-
#### Usage:
106-
* Adds a monitor to the mainFrame. Only as long as this frame is also the active Frame, the monitor will be shown
107-
```lua
108-
local mainFrame = basalt.createFrame("mainFrame"):show()
109-
local monitor1 = mainFrame:addMonitor("right"):show()
110-
monitor1:setBar("Monitor 1"):showBar()
111-
```
112-
113-
114-
### setMonitorScale
115-
Changes the monitor scale (almost the same as setTextScale())
116-
117-
#### Parameters:
118-
1. `number` Possible values are: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 (1 is the same as 0.5 by setTextScale, and 10 is the same as 5)
119-
120-
#### Returns:
121-
1. `monitor` The monitor being used
104+
1. `frame` The frame being used
122105

123106
#### Usage:
124-
* Changes the monitor scale to 2
107+
* Creates a new monitor frame, you can use to show objects on a monitor.
125108
```lua
126109
local mainFrame = basalt.createFrame("mainFrame"):show()
127-
local monitor1 = mainFrame:addMonitor("right"):setMonitorScale(2):show()
128-
monitor1:setBar("Monitor 1"):showBar()
129-
```
130-
131-
## ~~isModifierActive~~
132-
### _Disabled, this function is a WIP_
133-
Returns true if the user is currently holding the respective key down
134-
135-
#### Parameters:
136-
1. `number | string` - Any os.queueEvent("key") key, or you can use the following strings: "shift", "ctrl", "alt"
137-
138-
#### Returns:
139-
1. `boolean` - Whether the user is holding the key down
140-
141-
#### Usage:
142-
* Checks if the "shift" modifier is active on the myFrame frame
143-
```lua
144-
local isActive = myFrame:isModifierActive("shift")
145-
```
146-
* Creates a label, changing the text to "Shift is inactive oh no :(" and "Shift is active yay!", accordingly.
147-
```lua
148-
local aLabel = myFrame:addLabel("myFirstLabel"):setText("Shift is inactive oh no :(")
149-
myFrame:addButton("myFirstButton"):setText("Click"):onClick(
150-
function()
151-
if myFrame:isModifierActive("shift") then
152-
aLabel:setText("Shift is active yay!")
153-
else
154-
aLabel:setText("Shift is inactive oh no :(")
155-
end
156-
end
157-
)
110+
local monitorFrame = basalt.createFrame("mainFrame"):setMonitor("right"):show()
111+
monitorFrame:setBar("Monitor 1"):showBar()
158112
```
159-
160113
## getObject
161114
Returns a child object of the frame
162115

@@ -245,24 +198,8 @@ Sets whether the frame can be moved. _In order to move the frame click and drag
245198
local myFrame = basalt.createFrame("myFirstFrame"):setMovable(true)
246199
```
247200

248-
## ~~setMoveable~~
249-
### _Deprecated in favor of setMovable_
250-
251-
Sets whether the frame can be moved. _In order to move the frame use the upper bar of the frame_
252-
#### Parameters:
253-
1. `boolean` Whether the object is movable
254-
255-
#### Returns:
256-
1. `frame` The frame being used
257-
258-
#### Usage:
259-
* Creates a frame with id "myFirstFrame" and makes it movable
260-
```lua
261-
local myFrame = basalt.createFrame("myFirstFrame"):setMoveable(true)
262-
```
263-
264201
## setOffset
265-
Sets the frame's coordinate offset. The frame's child objects will receive the frame's coordinate offset. For example, when using the scrollbar, if you use its value to add an offset to a frame, you will get a scrollable frame.
202+
Sets the frame's coordinate offset. The frame's child objects will receive the frame's coordinate offset. For example, when using a scrollbar, if you use its value to add an offset to a frame, you will get a scrollable frame.
266203
Objects are also able to ignore the offset by using :ignoreOffset() (For example, you may want to ignore the offset on the scrollbar itself)
267204

268205
The function can be supplied negative offsets

0 commit comments

Comments
 (0)