From 859303e7a15fbd38abf6ce33260f882901e9ac48 Mon Sep 17 00:00:00 2001 From: Robert Jelic <36573031+NoryiE@users.noreply.github.com> Date: Thu, 8 Sep 2022 20:36:36 +0200 Subject: [PATCH 1/3] documentated multi-monitor support --- docs/objects/Frame.md | 1 + docs/objects/Frame/setMonitor.md | 28 ++++++++++++++++++++++++--- docs/objects/Frame/setMonitorScale.md | 15 ++++++++++++++ 3 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 docs/objects/Frame/setMonitorScale.md diff --git a/docs/objects/Frame.md b/docs/objects/Frame.md index 85df57c..daf318e 100644 --- a/docs/objects/Frame.md +++ b/docs/objects/Frame.md @@ -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) diff --git a/docs/objects/Frame/setMonitor.md b/docs/objects/Frame/setMonitor.md index 7e3e538..7cb0ae7 100644 --- a/docs/objects/Frame/setMonitor.md +++ b/docs/objects/Frame/setMonitor.md @@ -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 +``` + +* 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!") ``` \ No newline at end of file diff --git a/docs/objects/Frame/setMonitorScale.md b/docs/objects/Frame/setMonitorScale.md new file mode 100644 index 0000000..dbd848e --- /dev/null +++ b/docs/objects/Frame/setMonitorScale.md @@ -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") +``` From 3ca6ac5af0d1ecb26b8df7b96a6d7e38b51d657f Mon Sep 17 00:00:00 2001 From: Robert Jelic <36573031+NoryiE@users.noreply.github.com> Date: Sat, 10 Sep 2022 21:02:56 +0200 Subject: [PATCH 2/3] small docs fix someone is watching me --- docs/tips/design.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/tips/design.md b/docs/tips/design.md index 84be104..184daec 100644 --- a/docs/tips/design.md +++ b/docs/tips/design.md @@ -29,8 +29,8 @@ local anim = main:addAnimation() :setObject(sub) :move(2,4,1.5) :setObject(button) - :move(2,9,1,1.5): - setObject(button2) + :move(2,9,1,1.5) + :setObject(button2) :move(sub:getWidth()-12,9,1,1.5) :play() From 6f372fa0704910addfe80bc00bba7ac843e8e99a Mon Sep 17 00:00:00 2001 From: Robert Jelic <36573031+NoryiE@users.noreply.github.com> Date: Sun, 11 Sep 2022 11:40:49 +0200 Subject: [PATCH 3/3] docs update --- docs/objects/Animation/changeBackground.md | 6 +++--- docs/objects/Animation/changeText.md | 6 ++++-- docs/objects/Animation/changeTextColor.md | 6 +++--- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/docs/objects/Animation/changeBackground.md b/docs/objects/Animation/changeBackground.md index 0e4bf73..49ce526 100644 --- a/docs/objects/Animation/changeBackground.md +++ b/docs/objects/Animation/changeBackground.md @@ -2,9 +2,9 @@ Changes the background color while the animation is running #### Parameters: -1. `table` multiple color numbers - example: {colors.red, colors.yellow, colors.green} -2. `number` duration in seconds -3. `number` time - time when this part should begin (offset to when the animation starts - default 0) +1. `number` duration in seconds +2. `number` time - time when this part should begin (offset to when the animation starts - default 0) +3. `...` multiple color numbers - example: colors.red, colors.yellow, colors.green #### Returns: 1. `animation` Animation in use diff --git a/docs/objects/Animation/changeText.md b/docs/objects/Animation/changeText.md index d2bdb11..e9da7cb 100644 --- a/docs/objects/Animation/changeText.md +++ b/docs/objects/Animation/changeText.md @@ -3,8 +3,10 @@ Changes the text while animation is running #### Parameters: 1. `table` multiple text strings - example: {"i", "am", "groot"} -2. `number` duration in seconds -3. `number` time - time when this part should begin (offset to when the animation starts - default 0) +1. `number` duration in seconds +2. `number` time - time when this part should begin (offset to when the animation starts - default 0) +3. `...` multiple text strings - example: "i", "am", "groot" + #### Returns: 1. `animation` Animation in use diff --git a/docs/objects/Animation/changeTextColor.md b/docs/objects/Animation/changeTextColor.md index e23c586..d5420cf 100644 --- a/docs/objects/Animation/changeTextColor.md +++ b/docs/objects/Animation/changeTextColor.md @@ -2,9 +2,9 @@ Changes the text color while the animation is running #### Parameters: -1. `table` multiple color numbers - example: {colors.red, colors.yellow, colors.green} -2. `number` duration in seconds -3. `number` time - time when this part should begin (offset to when the animation starts - default 0) +1. `number` duration in seconds +2. `number` time - time when this part should begin (offset to when the animation starts - default 0) +1. `...` multiple color numbers - example: colors.red, colors.yellow, colors.green #### Returns: 1. `animation` Animation in use