Vectrune documentationAlpha referenceLearning site ↗

Browser and host APIs

Storage, audio, downloads, clipboard, fullscreen, and particle operations.

call

call <action>(arguments)

Invoke a named frontend action from a statement.

Runtime: Rune-Web host

Returns / effects

Action-dependent state effects.

Example
call add(1)

Implementation: runtime/rune-web/src/statement.ts

clipboard.copy

clipboard.copy(text)

Copy text using the host clipboard helper.

Runtime: Rune-Web host

Aliases: copy

Returns / effects

Clipboard side effect.

Example
clipboard.copy(text)

Implementation: runtime/rune-web/src/statement.ts

download

download(filename, content)

Download text content through the browser host.

Runtime: Rune-Web host

Returns / effects

Download side effect. No assigned return contract.

Example
download("save.json", content)

Implementation: runtime/rune-web/src/statement.ts

emitter.burst

<emitter>.burst(x, y[, count[, color[, speed]]])

Emit particles from a state-declared emitter.

Runtime: Rune-Web host

Returns / effects

Appends particle records, capped by the emitter maximum.

Example
sparks.burst(player.x, player.y)

Implementation: runtime/rune-web/src/statement.ts

emitter.step

<emitter>.step()

Advance particles, applying friction/gravity and expiring life.

Runtime: Rune-Web host

Returns / effects

Mutates the emitter particle array.

Example
sparks.step()

Implementation: runtime/rune-web/src/statement.ts

fullscreen.enter

fullscreen.enter()

Request fullscreen presentation.

Runtime: Rune-Web host

Returns / effects

Host-dependent fullscreen side effect.

Example
fullscreen.enter()

Implementation: runtime/rune-web/src/statement.ts

fullscreen.exit

fullscreen.exit()

Exit fullscreen presentation.

Runtime: Rune-Web host

Returns / effects

Host-dependent fullscreen side effect.

Example
fullscreen.exit()

Implementation: runtime/rune-web/src/statement.ts

fullscreen.toggle

fullscreen.toggle()

Toggle fullscreen presentation and the host fallback CSS state.

Runtime: Rune-Web host

Aliases: fullscreen, toggle_fullscreen

Returns / effects

Updates presentation and is_fullscreen when state is available.

Example
fullscreen.toggle()

Implementation: runtime/rune-web/src/statement.ts

music.compose

music.compose(name, lead, bass, drums[, time_signature[, bars]])

Register or update a composed music track.

Runtime: Rune-Web host

Aliases: music.register

Returns / effects

Audio definition side effect.

Example
music.compose("song", lead, bass, drums)

Implementation: runtime/rune-web/src/statement.ts

music.compose_song

music.compose_song(name, config)

Register a song from a structured configuration object.

Runtime: Rune-Web host

Aliases: music.register_song

Returns / effects

Audio definition side effect.

Example
music.compose_song("song", song)

Implementation: runtime/rune-web/src/statement.ts

music.delete_bar

music.delete_bar(bar)

Delete a Rune Studio bar.

Runtime: Rune-Web host

Returns / effects

Mutates Studio sequence state.

Example
music.delete_bar(bar)

Implementation: runtime/rune-web/src/statement.ts

music.delete_step

music.delete_step(id)

Delete a Rune Studio step by ID.

Runtime: Rune-Web host

Returns / effects

Mutates Studio step state.

Example
music.delete_step(id)

Implementation: runtime/rune-web/src/statement.ts

music.duplicate_bar

music.duplicate_bar(bar)

Duplicate a Rune Studio bar.

Runtime: Rune-Web host

Returns / effects

Mutates Studio sequence state.

Example
music.duplicate_bar(bar)

Implementation: runtime/rune-web/src/statement.ts

music.edit_steps

music.edit_steps(operation[, first[, second]])

Edit a note or bar in Rune Studio's fixed-measure sequencer.

Runtime: Rune-Web host

Returns / effects

Mutates Studio track, grid, and selection state.

Example
music.edit_steps("matrix", x, y)

Implementation: runtime/rune-web/src/statement.ts · runtime/rune-web/src/studio_sequencer.ts

music.pause

music.pause()

Pause current music playback.

Runtime: Rune-Web host

Returns / effects

Audio side effect.

Example
music.pause()

Implementation: runtime/rune-web/src/statement.ts

music.play

music.play([name[, start_beat[, fade_seconds]]])

Start a declared or composed music track.

Runtime: Rune-Web host

Aliases: play_music

Returns / effects

Audio playback side effect.

Example
music.play("theme", 4, 0.45)

Implementation: runtime/rune-web/src/statement.ts

music.resume

music.resume()

Resume paused music.

Runtime: Rune-Web host

Returns / effects

Audio side effect.

Example
music.resume()

Implementation: runtime/rune-web/src/statement.ts

music.select_step

music.select_step(id)

Select a Rune Studio piano-roll step.

Runtime: Rune-Web host

Returns / effects

Mutates Studio selection state.

Example
music.select_step(id)

Implementation: runtime/rune-web/src/statement.ts

music.stack_chord_note

music.stack_chord_note(id, note)

Stack a note into an existing Rune Studio step.

Runtime: Rune-Web host

Returns / effects

Mutates Studio step state.

Example
music.stack_chord_note(id, note)

Implementation: runtime/rune-web/src/statement.ts

music.stop

music.stop()

Stop current music playback.

Runtime: Rune-Web host

Returns / effects

Audio side effect.

Example
music.stop()

Implementation: runtime/rune-web/src/statement.ts

music.stretch_step

music.stretch_step(id, duration)

Change a Rune Studio note step duration.

Runtime: Rune-Web host

Returns / effects

Mutates Studio step state.

Example
music.stretch_step(id, duration)

Implementation: runtime/rune-web/src/statement.ts

music.sync_steps

music.sync_steps()

Synchronize Rune Studio step state with its song representation.

Runtime: Rune-Web host

Returns / effects

Mutates Studio-related state.

Example
music.sync_steps()

Implementation: runtime/rune-web/src/statement.ts

music.tempo

music.tempo = bpm

Set current music tempo.

Runtime: Rune-Web host

Returns / effects

Queues a tempo change on a whole beat beyond the Web Audio scheduling window.

Example
music.tempo = 140

Implementation: runtime/rune-web/src/statement.ts

music.volume

music.volume = volume

Set music playback volume.

Runtime: Rune-Web host

Returns / effects

Updates audio engine volume.

Example
music.volume = 0.5

Implementation: runtime/rune-web/src/statement.ts

restore

restore <path> | <path>.restore()

Restore initial state or entity start_ fields.

Runtime: Rune-Web host

Aliases: reset

Returns / effects

Mutates the target. Entity fallback also sets alive to true.

Example
restore enemies

Implementation: runtime/rune-web/src/statement.ts

sound.play

sound.play(name)

Play a declared synthesized sound.

Runtime: Rune-Web host

Aliases: play_sound

Returns / effects

Audio side effect.

Example
sound.play("shot")

Implementation: runtime/rune-web/src/statement.ts

storage.get

storage.get(key[, fallback])

Read JSON-backed local storage.

Runtime: Rune-Web host

Aliases: local_storage.get, localStorage.get

Returns / effects

Stored value or fallback.

Example
saved = storage.get("progress", null)

Implementation: runtime/rune-web/src/expression.ts

storage.has

storage.has(key)

Test for a local-storage key.

Runtime: Rune-Web host

Aliases: local_storage.has, localStorage.has

Returns / effects

Boolean.

Example
exists = storage.has("progress")

Implementation: runtime/rune-web/src/expression.ts

storage.remove

storage.remove(key)

Remove a local-storage key.

Runtime: Rune-Web host

Aliases: storage.delete, local_storage.remove

Returns / effects

Storage side effect.

Example
storage.remove("progress")

Implementation: runtime/rune-web/src/statement.ts

storage.set

storage.set(key, value)

Serialize a value to local storage.

Runtime: Rune-Web host

Aliases: storage.save, local_storage.set, localStorage.set

Returns / effects

Storage side effect.

Example
storage.set("progress", progress)

Implementation: runtime/rune-web/src/statement.ts