Skip to content

Builtins overview

Builtins are functions and events the runtime provides. They're the bridge between your script and the world it runs in — game memory, the framebuffer, the network, the gamepad.

How to read a signature

Signatures on these pages use Munos type annotations:

munos
draw_image(img: image, pal: u32[], x: i32, y: i32, flip_x: bool = false)
  • A trailing = value is a default; the argument may be omitted.
  • A trailing : type after the parameter list is the return type; its absence means the builtin returns nothing.
  • Each builtin notes its roleclient, server, or either. Calling one in the wrong role is a compile error.

The groups

GroupWhat's in it
Memoryread_u8read_i32, write_u8write_i32
Images & drawingimage_literal, image_from_bytes, image_from_bitmap_bytes, image_from_png_bytes, palette_from_png_bytes, draw_image
Networking & packingsend, event receive, pack, unpack, base64_decode, string_from_bytes
Inputevent input, input_held, input_pressed, consume_input
ROM controlpause_rom, resume_rom, local_rom_hash, disconnect
Server & slotsslot, max_clients, tick_rate, set_tick_rate, hop, redirect, connection events
Instancesspawn, find_instance, list_instances, player_count, tell, my_url, instance_url, uuid, list_scripts, shard_config, list_shards
Persistencedb_get, db_set, db_del, db_list, event db_error
Fetchfetch, event fetch_error
Miscprint, len, size, copy, push, pop, casts

Special forms

A few call-shaped features aren't ordinary builtins — they're compiler forms:

  • Castsi8(x)u32(x). See Types.
  • print — variadic; accepts any number of printable arguments.
  • len / size / copy / push / pop — operate on arrays (and len on strings). See Arrays.

These are covered on the Misc page.

Part of the MultiNostalgia project.