documentated multi-monitor support
This commit is contained in:
@@ -10,6 +10,7 @@ some special functionality to create very advanced programs.
|
||||
|[setBarTextAlign](objects/Frame/setBarTextAlign.md)|Sets the top bars text align - deprecated
|
||||
|[showBar](objects/Frame/showBar.md)|Shows the top bar - deprecated
|
||||
|[setMonitor](objects/Frame/setMonitor.md)|Sets the frame to be a monitor frame (only for base frames)
|
||||
|[setMonitorScale](objects/Frame/setMonitorScale.md)|Sets the monitor scale (same as monitor.setTextScale)
|
||||
|[setMirror](objects/Frame/setMirror.md)|Sets the frame to mirror onto a monitor (only for base frames)
|
||||
|[getObject](objects/Frame/getObject.md)|Returns the object by its name (or id)
|
||||
|[removeObject](objects/Frame/removeObject.md)|Removes the object by its name (or id)
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
## setMonitor
|
||||
Sets this frame as a monitor frame
|
||||
You can set base frames as monitor frames, don't try to use setMonitor on sub frames
|
||||
|
||||
#### Parameters:
|
||||
1. `string` The monitor name ("right", "left",... "monitor_1", "monitor_2",...)
|
||||
1. `string|table` The monitor name ("right", "left",... "monitor_1", "monitor_2",...) OR a table to create multi-monitors (see example)
|
||||
2. `number` optional - a number between 0.5 to 5 which sets the monitor scale
|
||||
|
||||
#### Returns:
|
||||
1. `frame` The frame being used
|
||||
@@ -12,8 +13,29 @@ Sets this frame as a monitor frame
|
||||
```lua
|
||||
local mainFrame = basalt.createFrame()
|
||||
local monitorFrame = basalt.createFrame():setMonitor("right")
|
||||
monitorFrame:setBar("Monitor 1"):showBar()
|
||||
monitorFrame:addLabel():setText("Hellooo!")
|
||||
```
|
||||
```xml
|
||||
<frame monitor="right"></frame>
|
||||
```
|
||||
|
||||
* 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
|
||||
monitor_1 is always your most top left monitor while monitor_6 is your most bottom right monitor.
|
||||
|
||||
Table structure:
|
||||
local monitors = {
|
||||
[y1] = {x1,x2,x3},
|
||||
[y2] = {x1,x2,x3}
|
||||
...
|
||||
}
|
||||
|
||||
```lua
|
||||
local monitors = {
|
||||
{"monitor_1", "monitor_2", "monitor_3"},
|
||||
{"monitor_4", "monitor_5", "monitor_6"}
|
||||
}
|
||||
|
||||
local mainFrame = basalt.createFrame()
|
||||
local monitorFrame = basalt.createFrame():setMonitor(monitors)
|
||||
monitorFrame:addLabel():setText("Hellooo!")
|
||||
```
|
||||
15
docs/objects/Frame/setMonitorScale.md
Normal file
15
docs/objects/Frame/setMonitorScale.md
Normal file
@@ -0,0 +1,15 @@
|
||||
## setMonitorScale
|
||||
Changes the scale on the the monitor which the frame is attached to
|
||||
|
||||
#### Parameters:
|
||||
1. `number` A number from 0.5 to 5
|
||||
|
||||
#### Returns:
|
||||
1. `frame` The frame being used
|
||||
|
||||
#### Usage:
|
||||
* Creates a new base frame, sets the frame as a monitor frame and changes the monitor scale
|
||||
```lua
|
||||
local myFrame = basalt.createFrame()setMonitor("left"):setMonitorScale(2)
|
||||
myFrame:addLabel("Monitor scale is bigger")
|
||||
```
|
||||
Reference in New Issue
Block a user