|
libscratchcpp
A library for C++ based Scratch project players
|
The Project class provides API for reading and running Scratch projects. More...
#include <scratchcpp/project.h>
Public Member Functions | |
| Project () | |
| Project (const std::string &fileName) | |
| Project (const Project &)=delete | |
| bool | load () |
| void | stopLoading () |
| void | start () |
| void | run () |
| void | runEventLoop () |
| const std::string & | fileName () const |
| void | setFileName (const std::string &newFileName) |
| std::shared_ptr< IEngine > | engine () const |
| sigslot::signal< unsigned int, unsigned int > & | downloadProgressChanged () |
The Project class provides API for reading and running Scratch projects.
| Project::Project | ( | ) |
Constructs Project without a file name. Use setFileName() to set a file name.
| Project::Project | ( | const std::string & | fileName | ) |
Constructs ScratchProject with the given file name.
|
delete |
| sigslot::signal< unsigned int, unsigned int > & Project::downloadProgressChanged | ( | ) |
Emits when the asset download progress changes.
| std::shared_ptr< IEngine > Project::engine | ( | ) | const |
Returns the engine of the loaded project.
| const std::string & Project::fileName | ( | ) | const |
Returns the project file name or URL.
| bool Project::load | ( | ) |
Loads the project. Returns true if successful.
| void Project::run | ( | ) |
Calls and runs "when green flag clicked" blocks.
| void Project::runEventLoop | ( | ) |
Runs the event loop. Call start() (from another thread) to start the project.
| void Project::setFileName | ( | const std::string & | newFileName | ) |
Sets the project file name or URL.
| void Project::start | ( | ) |
Calls all "when green flag clicked" blocks.
| void Project::stopLoading | ( | ) |
Cancels project loading if loading in another thread.