Generate pixel art of Scratch blocks.
This repository has been archived on 2025年10月01日 . You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
| examples | Update README.md and pyproject.toml | |
| fonts | Add new files and update dependencies | |
| src/scratchimg | add c min height | |
| .gitignore | Add new files and update dependencies | |
| .python-version | Add new files and update dependencies | |
| pyproject.toml | Update README.md and pyproject.toml | |
| README.md | Update README.md and pyproject.toml | |
| requirements-dev.lock | add c min height | |
| requirements.lock | add c min height | |
scratchimg
Create pixel art of Scratch blocks in Python.
stack = Stack(
[
Block(
styles["motion"],
["move", Literal("10"), "steps"],
),
Block(
styles["looks"],
["say", Literal("Hello!"), "for", Literal("2"), "seconds"],
),
Block(
styles["sound"],
["clear sound effects"],
),
Block(
styles["events"],
["broadcast", Menu("message1")],
),
Block(
styles["control"],
["wait", Literal("1"), "seconds"],
),
Block(
styles["sensing"],
["ask", Literal("What's your name?"), "and wait"],
),
Block(
styles["variables"],
[
"set",
Literal("my variable"),
"to",
Boolean(
styles["operators"],
[Literal("10"), "<", Literal("20")],
),
],
),
Block(
styles["lists"],
["add", Literal("thing"), "to", Menu("my list")],
),
Block(
styles["custom"],
[
"custom block",
Reporter(
styles["sensing"],
["mouse x"],
),
],
),
C(
styles["control"],
[
"if",
Boolean(styles["operators"], [Literal("A"), "=", Literal("a")]),
"then",
],
Stack([]),
),
]
)
c = C(
styles["control"],
["if", Boolean(styles["operators"], [Literal("A"), "=", Literal("a")]), "then"],
stack,
)