Skip to content
[~]drawing-functions.md: updated set_box_border() authored by cactusfluo's avatar cactusfluo
......@@ -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
position and dimension the box. A `border` string can be passed to style the
box. Here is how the border string works:
```
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
```
position and dimension the box. A `border` string or index can be passed to
style the box (see [set_box_border()](#set_box_border)).
The border string can also be set through `set_box_border()` (see
[set_box_border()](#set_box_border)).
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
- `y` Number: y coordinate of the box
- `width` Number: Width 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
```javascript
> set_box_border();
> set_box_border(index);
> set_box_border(characters);
```
Sets the `box()` border string. Next calls of `box()` will automatically use
this string if not passed into `box()` itself.
Sets the `box()` border string. `set_box_border()` takes a string, interpretated
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
string to it's default value.
### Parameter:
- `index` Number: Index of the predefined `box()` border
- `characters` String: String border of `box()`
## set_box_mode
......
......