Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Changes
Page history
[~]drawing-functions.md: updated set_box_border()
authored
Mar 16, 2020
by
cactusfluo
Hide whitespace changes
Inline
Side-by-side
api/drawing-functions.md
View page @
f5818cc8
...
@@ -134,23 +134,9 @@ function (x, y, is_on_layer) {
...
@@ -134,23 +134,9 @@ function (x, y, is_on_layer) {
```
```
Draws a box on the active layer.
`x`
,
`y`
,
`width`
and
`height`
are passed to
Draws a box on the active layer.
`x`
,
`y`
,
`width`
and
`height`
are passed to
position and dimension the box. A
`border`
string can be passed to style the
position and dimension the box. A
`border`
string or index can be passed to
box. Here is how the border string works:
style the box (see
[
set_box_border()
](
#set_box_border
)
).
```
with "0123456789..."
0: center
1: vertical line
2: horizontal line
3: top-left corner
4: top-right corner
5: bottom-left corner
6: bottom-right corner
7: top + bottom + right intersection
8: top + bottom + left intersection
9: left + right + top intersection
10: left + right + bottom intersection
11: left + right + top + bottom intersection
```
The border string can also be set through
`set_box_border()`
(see
The border string can also be set through
`set_box_border()`
(see
[
set_box_border()
](
#set_box_border
)
).
[
set_box_border()
](
#set_box_border
)
).
By default, the top-left corner of the box is placed at the passed coordinates,
By default, the top-left corner of the box is placed at the passed coordinates,
...
@@ -162,22 +148,42 @@ but it can also be placed differently via `set_box_mode()` (see
...
@@ -162,22 +148,42 @@ but it can also be placed differently via `set_box_mode()` (see
-
`y`
Number: y coordinate of the box
-
`y`
Number: y coordinate of the box
-
`width`
Number: Width of the box
-
`width`
Number: Width of the box
-
`height`
Number: Height of the box
-
`height`
Number: Height of the box
-
`border`
String: String border of the box
-
`border`
String
|| Number
: String border of the box
|| Index of the predefined border string
## set_box_border
## set_box_border
```
javascript
```
javascript
>
set_box_border
();
>
set_box_border
();
>
set_box_border
(
index
);
>
set_box_border
(
characters
);
>
set_box_border
(
characters
);
```
```
Sets the
`box()`
border string. Next calls of
`box()`
will automatically use
Sets the
`box()`
border string.
`set_box_border()`
takes a string, interpretated
this string if not passed into
`box()`
itself.
as the border string itself or a number, interpretated as a predefined border
string index (
`0`
,
`1`
or
`2`
).
Here is how a border string should be formatted:
```
with "0123456789..."
0: center
1: vertical line
2: horizontal line
3: top-left corner
4: top-right corner
5: bottom-left corner
6: bottom-right corner
7: top + bottom + right intersection
8: top + bottom + left intersection
9: left + right + top intersection
10: left + right + bottom intersection
11: left + right + top + bottom intersection
```
Calling
`set_box_border()`
without any parameter resets the
`box()`
border
Calling
`set_box_border()`
without any parameter resets the
`box()`
border
string to it's default value.
string to it's default value.
### Parameter:
### Parameter:
-
`index`
Number: Index of the predefined
`box()`
border
-
`characters`
String: String border of
`box()`
-
`characters`
String: String border of
`box()`
## set_box_mode
## set_box_mode
...
...
...
...