A library for C++ based Scratch project players
Report Bug
·
Request Feature
Table of Contents
libscratchcpp is a library for building C++ based Scratch project players.
It provides an API for reading and running Scratch projects which makes it easy to create a GUI application that runs Scratch projects.
The idea is to implement Scratch blocks in C++ to build a fast project player that is faster than the original Scratch VM.
This library is still in development and it shouldn't be used to build complete Scratch project players yet.
There might be incompatible API changes anytime before version 1.0.0 releases!
We're working on the documentation, it'll be available soon.
A minimal CLI program for running Scratch projects:
#include <scratchcpp/project.h>
int main(int argc, char **argv) {
libscratchcpp::Project p("/path/to/project.sb3");
bool ret = p.load();
if (!ret)
return 1;
p.run();
return 0;
}
Loading projects from scratch.mit.edu is supported too:
libscratchcpp::Project p("https://scratch.mit.edu/projects/XXXXXX");
- Motion blocks
- Looks blocks
- Sound blocks
- Event blocks
- Control blocks
- Sensing blocks
- Operator blocks
- Custom blocks
- Top level reporter blocks
- Broadcasts
- Variables
- Lists
- Clones
- Timer
- API for monitors
- Project metadata
- Turbo mode
- Custom FPS in the default event loop (
libscratchcpp::Engine::run()
) - Scratch 2.0 project loader (help needed)
- Scratch 1.4 and below project loader (help needed)
- API for comments
- API for loading projects from URL
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Format changed source files (
clang-format src/some_file.cpp
) - Commit your Changes (
git add -A && git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the Apache-2.0 License. See LICENSE for more information.