An example extension for Xcratch
This extension add extra-block "do it", that executes string in its input field as a sentence in Javascript and return the result.
Play Example Project to look at what you can do with "Xcratch Example" extension.
<iframe src="https://xcratch.github.io/editor/player#https://xcratch.github.io/xcx-example/projects/example.sb3" width="540px" height="460px"></iframe>This extension can be used with other extension in Xcratch.
- Open Xcratch Editor
- Click 'Add Extension' button
- Select 'Extension Loader' extension
- Type the module URL in the input field
https://engineeringeducationsteve.github.io/scratch-extension-example/dist/xcratchExample.mjs
- Click 'OK' button
- Now you can use the blocks of this extension
npm installChange vmSrcOrg to your local scratch-vm directory in ./scripts/setup-dev.js then run setup-dev script to setup development environment.
npm run setup-devRun build script to bundle this extension into a module file which could be loaded on Xcratch.
npm run buildRun watch script to watch the changes of source files and bundle automatically.
npm run watchRun test script to test this extension.
npm run testOpen this page from https://xcratch.github.io/xcx-example/
Contributions, issues and feature requests are welcome!
Feel free to check issues page.