StageBuilder

Properties

Link copied to clipboard

Functions

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

Adds a backdrop from a local file.

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
open override fun <B : HatBlock> addHatBlock(hatBlock: B): B

Adds a hat block to this host.

Link copied to clipboard
fun addSound(path: Path, name: String): Sound

Adds a sound from a local file to the stage.

fun addSound(name: String, dataFormat: String, assetId: String, rate: Int? = null, sampleCount: Int? = null, path: Path? = null): Sound

Adds a sound to the stage.

Link copied to clipboard

Implements the logic for a custom block procedure.

Link copied to clipboard

Creates an isolated stack of blocks that is not attached to any hat block.

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

Creates a global broadcast message (scoped to the stage).

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

Creates a global list with a builder (scoped to the stage).

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

Creates a global list (scoped to the stage).

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

Creates a global variable (scoped to the stage).

Link copied to clipboard

Defines a custom block procedure.

Link copied to clipboard

Creates a 'when backdrop switches to' hat block.

Link copied to clipboard

Creates a 'when this sprite clicked' hat block.

Link copied to clipboard

Creates a 'when loudness >' or 'when timer >' hat block.

Link copied to clipboard

Creates a 'when green flag clicked' hat block.

Link copied to clipboard

Creates a 'when I receive' hat block.

Link copied to clipboard

Creates a 'when I start as a clone' hat block.

Link copied to clipboard

Creates a 'when key pressed' hat block.