API Reference

The Naucto Lua API provides a small, focused set of functions for building games. All functions are available as globals in your Lua scripts.

Summary

Function

Description

clear()

Clear the screen with a palette color

sprite()

Draw a sprite or block of sprites

map()

Draw the tilemap

mget()

Read a tile from the tilemap

fget()

Read sprite flags

camera()

Set the camera offset

line()

Draw a line

rect()

Draw an outlined rectangle

fill_rect()

Draw a filled rectangle

key_pressed()

Check if a key is held down

print()

Write text to the output panel

set_col()

Remap a palette color

reset_col()

Restore the original palette

play_music()

Play a Sound Editor music slot

stop_music()

Stop music playback

net.host()

Host an online multiplayer session

net.join()

Join an online multiplayer session

net.leave()

Leave the current session

net.id()

Your player id in the session

net.state

Table shared by all players

net.emit()

Send a custom event to the other players

net.on()

React to network events and changes

net.lock()

Mutual exclusion between players

net.queue()

Shared first-in, first-out queue