Skip to content

Extension: "SVG" #2005

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 64 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
d8d4660
Merge pull request #1 from TurboWarp/master
WAYLIVES Feb 25, 2025
950a9de
Create 1.0.0.js
WAYLIVES Feb 28, 2025
3d09c90
[Automated] Format code
DangoCat Feb 28, 2025
a1a7359
Update 1.0.0.js
WAYLIVES Feb 28, 2025
e7b0867
Update 1.0.0.js
WAYLIVES Feb 28, 2025
a33d0b2
[Automated] Format code
DangoCat Feb 28, 2025
ea8e1e5
Update 1.0.0.js
WAYLIVES Feb 28, 2025
e01604f
Update 1.0.0.js
WAYLIVES Feb 28, 2025
1188bb5
Update 1.0.0.js
WAYLIVES Feb 28, 2025
a2c43fb
Update 1.0.0.js
WAYLIVES Feb 28, 2025
537c8c7
Update 1.0.0.js
WAYLIVES Feb 28, 2025
5f6b77d
Update 1.0.0.js
WAYLIVES Feb 28, 2025
77c3421
Create Window Settings.svg
WAYLIVES Feb 28, 2025
4e77dc8
Update 1.0.0.js
WAYLIVES Feb 28, 2025
02ebdfd
Rename 1.0.0.js to 1.0.0.js
WAYLIVES Feb 28, 2025
e4e2c9f
Rename Window Settings.svg to Window Settings.svg
WAYLIVES Feb 28, 2025
db656c4
Update and rename 1.0.0.js to 2.0.0.js
WAYLIVES Mar 1, 2025
2411fe3
Update 2.0.0.js
WAYLIVES Mar 1, 2025
46abee7
Create 1.0.1.js
WAYLIVES Mar 2, 2025
1ff413f
Delete extensions/WAYLIVES/SVG directory
WAYLIVES Mar 2, 2025
568253c
Create 1.0.1.js
WAYLIVES Mar 2, 2025
8331ebd
Delete extensions/WAYLIVES/Window Settings/SVG directory
WAYLIVES Mar 2, 2025
bf6a38f
Create 1.0.1.js
WAYLIVES Mar 2, 2025
e198545
[Automated] Format code
DangoCat Mar 2, 2025
90d23ab
Update 1.0.1.js
WAYLIVES Mar 3, 2025
36f60c6
[Automated] Format code
DangoCat Mar 3, 2025
0831d51
Update 1.0.1.js
WAYLIVES Mar 3, 2025
4bfba54
Update 1.0.1.js
WAYLIVES Mar 3, 2025
d618b30
Update 1.0.1.js
WAYLIVES Mar 3, 2025
c66d90c
Update 1.0.1.js
WAYLIVES Mar 3, 2025
926a0b3
Update 1.0.1.js
WAYLIVES Mar 3, 2025
70d66d4
Update 1.0.1.js
WAYLIVES Mar 3, 2025
487e7ad
[Automated] Format code
DangoCat Mar 3, 2025
e3e9b88
Create SVG.svg
WAYLIVES Mar 3, 2025
a803ef6
Update 1.0.1.js
WAYLIVES Mar 3, 2025
38c8a1f
[Automated] Format code
DangoCat Mar 3, 2025
acecb61
Update 1.0.1.js
WAYLIVES Mar 4, 2025
669d9bd
Update 1.0.1.js
WAYLIVES Mar 4, 2025
b178019
Update 1.0.1.js
WAYLIVES Mar 4, 2025
ea6a2b2
Update 1.0.1.js
WAYLIVES Mar 4, 2025
dad2315
[Automated] Format code
DangoCat Mar 4, 2025
acd5f75
Update 1.0.1.js
WAYLIVES Mar 4, 2025
ae3eed2
Update 1.0.1.js
WAYLIVES Mar 4, 2025
618e2a0
Update 1.0.1.js
WAYLIVES Mar 4, 2025
4a4f4f3
Update 1.0.1.js
WAYLIVES Mar 4, 2025
f2f0f5a
[Automated] Format code
DangoCat Mar 4, 2025
147f340
Delete extensions/WAYLIVES/Window Settings directory
WAYLIVES Mar 4, 2025
fdd49ac
Update extensions.json
WAYLIVES Mar 4, 2025
eaa65e7
Create SVG.md
WAYLIVES Mar 5, 2025
9fb195b
Update SVG.md
WAYLIVES Mar 5, 2025
808a8b5
Update SVG.md
WAYLIVES Mar 5, 2025
d06fcd9
Update SVG.md
WAYLIVES Mar 5, 2025
7afe800
Update SVG.md
WAYLIVES Mar 5, 2025
385cc0f
Update SVG.md
WAYLIVES Mar 5, 2025
4fdd134
Update 1.0.1.js
WAYLIVES Mar 5, 2025
41ea579
Update 1.0.1.js
WAYLIVES Mar 5, 2025
d9f1c7a
Delete images/WAYLIVES/Window Settings.svg
WAYLIVES Mar 5, 2025
50a3324
Update SVG.md
WAYLIVES Mar 5, 2025
2645267
Update SVG.md
WAYLIVES Mar 5, 2025
0955787
Add files via upload
WAYLIVES Mar 5, 2025
a51e001
Update SVG.md
WAYLIVES Mar 5, 2025
a9fa4e1
Delete samples/SVG.sb3
WAYLIVES Mar 5, 2025
40cac2a
Update 1.0.1.js
WAYLIVES Mar 7, 2025
5b3ee0a
[Automated] Format code
DangoCat Mar 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 118 additions & 0 deletions docs/WAYLIVES/SVG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# SVG

SVG is an XML language that is designed for drawing vector images. There are two types of images: raster and vector, so using SVG you can draw vector graphics.

Example:

<img src="https://github.com/WAYLIVES/my-extensions/blob/main/extensions/SVG/doc/11.png">
&emsp;<i>- This image belongs to @WAYLIVES</i>

##

Using the "SVG" extension, you can create code for simple SVG images, where the following elements will be available:
- line
- rectangle
- circle

## Блоки
### SVG-frame:
```scratch
(SVG-frame // width:[100] height:[100] elements in svg:[...] :: #9823FF)
```
<img src="https://github.com/WAYLIVES/my-extensions/blob/main/extensions/SVG/doc/s1.svg">

Nothing will work without this block, it sets the beginning and end of vector images.

(width) - here you set the width of the SVG format

(height) - here you set the height of the SVG format

(elements in svg) - here you can insert SVG elements with which you will draw images.

### Line:

```scratch
(LINE // x1, y1:[4][4] x2, y2:[96][96] width:[8] color:[#FF0000] opacity:[100]% dash, gap:[0][0] linecap:[round v] :: #9823FF)
```
<img src="https://github.com/WAYLIVES/my-extensions/blob/main/extensions/SVG/doc/s2.svg">

You can use this block to draw lines.

(x1), (y2) - is the position of the first point of the line along the X, Y coordinate (SVG coordinates: https://developer.mozilla.org/en/docs/Web/SVG/Tutorial/Positions ).

(x2), (y2) - is the position of the end (second) point of the line along the X, Y coordinate.

(width) - here you can set the line thickness.

(color) - here you set the color of the line.

(opacity) - here you set the transparency of the line as a percentage (%).

(dash), (gap) - you can use these parameters to set the line type. Dash is the length of the dotted lines. Gap is the indentation, i.e. the distance between the dotted lines.

(linecap) - here you can set the shape of the line ends (more details here: https://developer.mozilla.org/en/docs/Web/SVG/Attribute/stroke-linecap ).

Linecap:

<img src="https://github.com/WAYLIVES/my-extensions/blob/main/extensions/SVG/doc/14.svg">

### Rect:

```scratch
(RECT // x, y:[4][4] width:[92] height:[92] radius:[20] fill color:[#FF0000] fill opacity:[100]% stroke width:[8] stroke color[#000000] stroke opacity:[100]% dash, gap:[0][0] stroke linecap:[round v] :: #9823FF)
```
<img src="https://github.com/WAYLIVES/my-extensions/blob/main/extensions/SVG/doc/s3.svg">

You can use this block to draw rectangles and squares.

(x), (y) - is the position of the rectangle's starting point along the X, Y coordinate.

(width), (height) - are the width and height of the rectangle.

(radius) - here you set the rounded corners of the rectangle.

(fill color) - here you set the fill color of the rectangle.

(fill opacity) - here you set the transparency of the rectangle fill as a percentage (%).

(stroke width) - here you set the stroke thickness of the rectangle.

(stroke color) - here you set the stroke color.

(stroke opacity) - here you set the transparency of the stroke.

(dash), (gap) - you can use these parameters to set the line type. Dash is the length of the dotted lines. Gap is the indentation, i.e. the distance between the dotted lines.

(linecap) - here you can set the shape of the line ends.

### Ellipse:

```scratch
(ELLIPSE // cx, cy:[50][50] width:[92] height:[92] fill color:[#FF0000] fill opacity:[100]% stroke width:[8] stroke color[#000000] stroke opacity:[100]% dash, gap:[0][0] stroke linecap:[round v] :: #9823FF)
```
<img src="https://github.com/WAYLIVES/my-extensions/blob/main/extensions/SVG/doc/s4.svg">

You can use this block to draw circles and ovals.

(cx), (cy) - is the position of the center point of the circle along the X, Y coordinate.

(width), (height) - are the width and height of the circle.

(fill color) - here you set the fill color.

(fill opacity) - here you set the transparency of the fill as a percentage (%).

(stroke width) - here you set the thickness of the circle outline.

(stroke color) - here you set the stroke color.

(stroke opacity) - here you set the transparency of the stroke.

(dash), (gap) - you can use these parameters to set the line type. Dash is the length of the dotted lines. Gap is the indentation, i.e. the distance between the dotted lines.

(linecap) - here you can set the shape of the line ends.

## Пример-проект

<img src="https://github.com/WAYLIVES/my-extensions/blob/main/extensions/SVG/doc/12.png">
<img src="https://github.com/WAYLIVES/my-extensions/blob/main/extensions/SVG/doc/13.png">
Loading