Setting Up Menus and Keys

For a list of menu/key related commands, click here.

About controllers

A controller is an event that has occured due to the user selecting a menu item or pressing a key. There are 50 controllers available (numbered from 0-49), and menu items and keys are assigned to them. To test whether the event has occured, use the controller test command, like this:

if (controller(c2)) {

The above example tests for controller 2 (which could be assigned to "quit" on the menu), and if it has occured, it quits the game.

Setting up menus

First use the command to create a menu. Then use the command to add items to it. Repeat this process until all the menus have been set up, and then use the command to initialize it, making it available for use. Here is an example of creating a menu:"File");"Restart",c1);"Quit","c2);"Help");"About);;

The second parameter of the command is the controller that the menu item is being assigned to. You can assign multiple menu items and keys to the one controller, for example most game functions like save, restore, quit etc. usually have both a menu item and a key.

The menu can be brought up using the menu.input command.

Setting up keys

Use the set.key command.