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
= valueis a default; the argument may be omitted. - A trailing
: typeafter the parameter list is the return type; its absence means the builtin returns nothing. - Each builtin notes its role —
client,server, or either. Calling one in the wrong role is a compile error.
The groups
| Group | What's in it |
|---|---|
| Memory | read_u8 … read_i32, write_u8 … write_i32 |
| Images & drawing | image_literal, image_from_bytes, image_from_bitmap_bytes, image_from_png_bytes, palette_from_png_bytes, draw_image |
| Networking & packing | send, event receive, pack, unpack, base64_decode, string_from_bytes |
| Input | event input, input_held, input_pressed, consume_input |
| ROM control | pause_rom, resume_rom, local_rom_hash, disconnect |
| Server & slots | slot, max_clients, tick_rate, set_tick_rate, hop, redirect, connection events |
| Instances | spawn, find_instance, list_instances, player_count, tell, my_url, instance_url, uuid, list_scripts, shard_config, list_shards |
| Persistence | db_get, db_set, db_del, db_list, event db_error |
| Fetch | fetch, event fetch_error |
| Misc | print, len, size, copy, push, pop, casts |
Special forms
A few call-shaped features aren't ordinary builtins — they're compiler forms:
- Casts —
i8(x)…u32(x). See Types. print— variadic; accepts any number of printable arguments.len/size/copy/push/pop— operate on arrays (andlenon strings). See Arrays.
These are covered on the Misc page.