Skip to content

Commit 859303e

Browse files
committed
documentated multi-monitor support
1 parent 51f6ebe commit 859303e

File tree

3 files changed

+41
-3
lines changed

3 files changed

+41
-3
lines changed

docs/objects/Frame.md

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ some special functionality to create very advanced programs.
1010
|[setBarTextAlign](objects/Frame/setBarTextAlign.md)|Sets the top bars text align - deprecated
1111
|[showBar](objects/Frame/showBar.md)|Shows the top bar - deprecated
1212
|[setMonitor](objects/Frame/setMonitor.md)|Sets the frame to be a monitor frame (only for base frames)
13+
|[setMonitorScale](objects/Frame/setMonitorScale.md)|Sets the monitor scale (same as monitor.setTextScale)
1314
|[setMirror](objects/Frame/setMirror.md)|Sets the frame to mirror onto a monitor (only for base frames)
1415
|[getObject](objects/Frame/getObject.md)|Returns the object by its name (or id)
1516
|[removeObject](objects/Frame/removeObject.md)|Removes the object by its name (or id)

docs/objects/Frame/setMonitor.md

+25-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
## setMonitor
2-
Sets this frame as a monitor frame
2+
You can set base frames as monitor frames, don't try to use setMonitor on sub frames
33

44
#### Parameters:
5-
1. `string` The monitor name ("right", "left",... "monitor_1", "monitor_2",...)
5+
1. `string|table` The monitor name ("right", "left",... "monitor_1", "monitor_2",...) OR a table to create multi-monitors (see example)
6+
2. `number` optional - a number between 0.5 to 5 which sets the monitor scale
67

78
#### Returns:
89
1. `frame` The frame being used
@@ -12,8 +13,29 @@ Sets this frame as a monitor frame
1213
```lua
1314
local mainFrame = basalt.createFrame()
1415
local monitorFrame = basalt.createFrame():setMonitor("right")
15-
monitorFrame:setBar("Monitor 1"):showBar()
16+
monitorFrame:addLabel():setText("Hellooo!")
1617
```
1718
```xml
1819
<frame monitor="right"></frame>
20+
```
21+
22+
* Here is a example on how to create mutlimonitors. You always have to start on the top left of your screen and go to the bottom right, which means in this example
23+
monitor_1 is always your most top left monitor while monitor_6 is your most bottom right monitor.
24+
25+
Table structure:
26+
local monitors = {
27+
[y1] = {x1,x2,x3},
28+
[y2] = {x1,x2,x3}
29+
...
30+
}
31+
32+
```lua
33+
local monitors = {
34+
{"monitor_1", "monitor_2", "monitor_3"},
35+
{"monitor_4", "monitor_5", "monitor_6"}
36+
}
37+
38+
local mainFrame = basalt.createFrame()
39+
local monitorFrame = basalt.createFrame():setMonitor(monitors)
40+
monitorFrame:addLabel():setText("Hellooo!")
1941
```

docs/objects/Frame/setMonitorScale.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
## setMonitorScale
2+
Changes the scale on the the monitor which the frame is attached to
3+
4+
#### Parameters:
5+
1. `number` A number from 0.5 to 5
6+
7+
#### Returns:
8+
1. `frame` The frame being used
9+
10+
#### Usage:
11+
* Creates a new base frame, sets the frame as a monitor frame and changes the monitor scale
12+
```lua
13+
local myFrame = basalt.createFrame()setMonitor("left"):setMonitorScale(2)
14+
myFrame:addLabel("Monitor scale is bigger")
15+
```

0 commit comments

Comments
 (0)