Open aquino-luane opened 2 months ago
Loading a project from a file can be done using the loadProject()
method from scratch-vm, which accepts the contents of the file as an ArrayBuffer. See the implementation of the "Load from your computer" option: https://github.com/scratchfoundation/scratch-gui/blob/cb056c5/src/lib/sb-file-uploader-hoc.jsx#L145-L171
Loading a project from a file can be done using the
loadProject()
method from scratch-vm, which accepts the contents of the file as an ArrayBuffer. See the implementation of the "Load from your computer" option: https://github.com/scratchfoundation/scratch-gui/blob/cb056c5/src/lib/sb-file-uploader-hoc.jsx#L145-L171
I will check, thank you 🙏🏽
I have a .sb3 file that is returned from an API, and I want to load it into the editor when the app starts.
It seems that I need to set the project files into scratch-storage, but I am not sure if this is correct or how to do it.
Could someone please guide me on how to load the .sb3 file into the editor when the app starts?
Thank you!