Optionalcostume: CostumeOptionalcostume: CostumeOptionaltargetId: stringOptionalversion: 2Loads a sprite from a compressed .sprite2 or .sprite3 or JSON.
Remove everything from the VM.
Deletes the costume at a given index int he editing target.
If a costume was deleted, returns a function to undo the deletion.
Deletes the sound at a given index in the editing target.
If a sound was deleted, returns a function to undo the deletion.
Deletes the target with the given ID and any of its clones.
If a sprite was deleted, returns a function to undo the deletion.
Optionalzip: JSZipLoad a project usings its ID from scratch.mit.edu.
Emit a targetsUpdate event about the current target information.
OptionalshouldTriggerProjectChange: booleanWhether a PROJECT_CHANGED event should be emitted. Defaults to true.
Emit a workspaceUpdate event.
Export a specific sprite to a compressed sprite3 file.
The ID of the target
Export a specific sprite to a compressed sprite3 file.
The ID of the target
Gets the string representation of a costume. For an SVG costume, returns the text. For a PNG or JPG costume, returns a data URL. If costume doesn't exist, returns null.
Load a project.
Compressed sb, sb2, sb3 or sb2 project.json or sb3 project.json.
Post sprite info to the target that's being dragged, otherwise the editing target.
the project to a compressed sb3 file.
the project to a compressed sb3 file.
Changes whether the runtime is in "compatibility mode" (true by default) Compatibility mode sets the runtime's framerate to 30 FPS. Disabling it sets the framerate to 60 FPS.
Changes whether the runtime is in turbo mode or not. Emits either TURBO_MODE_ON or TURBO_MODE_OFF.
whether turbo mode should be enabled
Updates the value of a variable. Returns true if the target and variable were successfully found and updated, otherwise null.
Share a costume from the editing target to another target.
Share a sound from the editing target to another target.
OptionaltargetId: stringUpdate a sound.
The index of the sound in the current sprite
The new audio data
OptionalencodedWAV: ArrayBufferThe data of an encoded WAV. If not provided, the new sound won't be saved if the project is exported.
The target that's currently being dragged, if any.