Properties

Link copied to clipboard

Where the builder will look for assets to be included in a sb3 file.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun addBackdrop(path: Path, name: String): Backdrop

Adds a backdrop from a local file path.

fun addBackdrop(name: String, dataFormat: String, assetId: String, rotationCenter: Pair<Double, Double>? = null, bitmapResolution: Int = 1, path: Path? = null): Backdrop

Adds a backdrop to the stage.

Link copied to clipboard
fun addExtension(extensionRepresentation: Representation)

Adds a Scratch extension to the project.

Link copied to clipboard

Attaches monitor data from a JSON string. Can be obtained by first building without it, then configuring the monitors in the scratch editor and extracting it from the project.json. Not required.

Attaches monitor data from a JSON element. Can be obtained by first building without it, then configuring the monitors in the scratch editor and extracting it from the project.json. Not required.

Link copied to clipboard
fun extractMonitorDataFrom(path: Path)

Extracts monitor data from a project file (project.json or .sb3).

Link copied to clipboard
fun makeBroadcast(name: String = IdGenerator.makeRandomId(6)): Broadcast

Creates a global broadcast message.

Link copied to clipboard
fun makeGlobalList(name: String = IdGenerator.makeRandomId(6), block: JsonArrayBuilder.() -> Unit): ScratchList

Creates a global list with a builder.

fun makeGlobalList(name: String = IdGenerator.makeRandomId(6), value: JsonArray): ScratchList

Creates a global list.

Link copied to clipboard
fun makeGlobalVar(name: String = IdGenerator.makeRandomId(6), value: JsonPrimitive = JsonPrimitive(""), cloud: Boolean = false): Variable

Creates a global variable.

Link copied to clipboard
fun makeLocalBroadcastSlot(name: String = IdGenerator.makeRandomId(6)): BroadcastSlot

Creates a local broadcast slot for use in sprites.

Link copied to clipboard
fun makeLocalListSlot(name: String = IdGenerator.makeRandomId(6), block: JsonArrayBuilder.() -> Unit): ScratchListSlot

Creates a local list slot with a builder for use in sprites.

fun makeLocalListSlot(name: String = IdGenerator.makeRandomId(6), value: JsonArray): ScratchListSlot

Creates a local list slot for use in sprites.

Link copied to clipboard
fun makeLocalVarSlot(name: String = IdGenerator.makeRandomId(6), value: JsonPrimitive = JsonPrimitive(""), cloud: Boolean = false): VariableSlot

Creates a local variable slot for use in sprites.

Link copied to clipboard
fun BuildRoot.modifyProject(path: Path)

Modifies an existing Scratch project file (.sb3) with the generated project JSON.

Link copied to clipboard
open override fun represent(): JsonObject
Link copied to clipboard

Creates and configures a new sprite.

Link copied to clipboard
fun stage(block: StageBuilder.() -> Unit): StageBuilder

Configures the stage.

Link copied to clipboard

Converts the built project into a ProjectJson object containing the JSON string.

Link copied to clipboard
fun BuildRoot.writeTo(path: Path)

Writes the project to a .sb3 file, including all assets.

Link copied to clipboard

Writes the project JSON to a file at the specified path.