Changes
Page history
[~]*-functions.md: update polygon and added iter/map_func()
authored
Apr 15, 2020
by
gibbonjoyeux
Show whitespace changes
Inline
Side-by-side
api/drawing-functions.md
View page @
65ad7455
...
...
@@ -24,7 +24,7 @@
-
[
set_text_align
](
#set_text_align
)
-
[
set_text_wrap
](
#set_text_wrap
)
-
[
Other
](
#other
)
-
[
shape
](
#shape
)
-
[
polygon
](
#polygon
)
-
[
fill
](
#fill
)
-
[
border
](
#border
)
-
[
set_draw_mode
](
#set_draw_mode
)
...
...
@@ -335,41 +335,41 @@ than the text / paragraph width).
# Other
##
shape
##
polygon
```
javascript
>
shape
(
x
,
y
,
r
adius_x
,
radius_
y
,
vertices
,
char
acter
);
>
shape
(
x
,
y
,
r
adius_x
,
radius_
y
,
vertices
,
char
acter
,
linked
);
>
shape
(
x
,
y
,
r
adius_x
,
radius_
y
,
vertices
,
char
acter
,
linked
,
rotation
_offset
);
>
polygon
(
x
,
y
,
r
x
,
r
y
,
vertices
,
char
_edges
);
>
polygon
(
x
,
y
,
r
x
,
r
y
,
vertices
,
char
_edges
,
char_fill
);
>
polygon
(
x
,
y
,
r
x
,
r
y
,
vertices
,
char
_edges
,
char_fill
,
rotation
);
```
Draws a shape on the active layer. The shape is positioned at
`x`
and
`y`
passed
coordinates. The value of
`vertices`
defines the number of sides of the shape.
With 3 vertices, the shape would be a
**triangle**
, with 4, a
**square**
etc.
The bigger this value is, the nearer the shape would be to a
**circle**
.
Draws a polygon on the active layer. The polygon is positioned at
`x`
and
`y`
passed coordinates. The value of
`vertices`
defines the number of edges of the
polygon.
With 3 vertices, the polygon would be a
**triangle**
, with 4, a
**square**
etc.
The bigger this value is, the nearer the polygon would be to a
**circle**
.
`r
adius_
x`
and
`r
adius_
y`
are used to modify the
shape
width / height ratio. As
most fonts
have characters taller than bigger, it is important to make some
tests with your
font to know which radius would give the
shape
you want.
`rx`
and
`ry`
are used to modify the
polygon
width / height ratio. As
most fonts
have characters taller than bigger, it is important to make some
tests with your
font to know which radius would give the
polygon
you want.
`character`
is used to draw the shape.
`char_edges`
is the character used to draw the polygon's edges.
`char_fill`
is the character used to fill the polygon. If
`char_fill`
is not
passed or passed as
`null`
, only the edges will be drawn.
If
`linked`
(
`true`
by default) is set to
`false`
, sides of the shape will not
be drawn. Only the corners will.
`rotation_offset`
(
`0`
by default) is a number value (between
`0`
and
`1`
) which
sets the shape rotation offset between 2 corners. Looping from
`0`
to
`1`
would
make the shape rotate continually.
`rotation`
(
`0`
by default) is a number value (between
`0`
and
`1`
) which sets
the polygon rotation offset between 2 corners. Looping from
`0`
to
`1`
would
make the polygon rotate continually.
### Parameters:
-
`x`
Number: x coordinate of the
shape
center
-
`y`
Number: y coordinate of the
shape
center
-
`r
adius_
x`
Number: Width of the
shape
-
`r
adius_
y`
Number: Height of the
shape
-
`vertices`
Number: Number of vertices of the
shape
-
`char
acter
`
Character
s
(string): Character used to draw the
shape
-
`
linked`
Boolean: If
`true`
, vertices are drawn. If not, only corners are
-
`rotation
_offset
`
Number: Between
`0`
and
`1`
, set the
shape
angle based on the difference between two corners
-
`x`
Number: x coordinate of the
polygon
center
-
`y`
Number: y coordinate of the
polygon
center
-
`rx`
Number: Width of the
polygon
-
`ry`
Number: Height of the
polygon
-
`vertices`
Number: Number of vertices of the
polygon
-
`char
_edges
`
Character (string): Character used to draw the
polygon's edges
-
`
char_fill`
Character (string): Character used to fill the polygon
-
`rotation`
Number: Between
`0`
and
`1`
, set the
polygon
angle based on the difference between two corners
## fill
...
...
...
...