API Custom Menu Items - THE-ORONCO/pico-8 GitHub Wiki
Custom Menu Items
MENUITEM(INDEX, [LABEL], [CALLBACK])
Add an extra item to the pause menu
Index should be 1…5 and determines the order each menu item is displayed label should be a string up to 16 characters long callback is a function called when the item is selected by the users.
When no label or function is supplied, the menu item is removed
MENUITEM(1, "RESTART PUZZLE",
FUNCTION() RESET_PUZZLE() SFX(10) END
)
If the callback returns true, the pause menu remains open. The callback takes a single parameter that is a bitfield of L, R, X button presses
MENUITEM(1, "FOO",
FUNCTION(B) IF (B&1 > 0) THEN PRINTH("LEFT WAS PRESSED") END END
)