From AGI Wiki
Jump to: navigation, search

The command adds a menu item to a menu.

Syntax mA, ctl cB);"menu item text", ctl cB);


In AGI menus are the displayed along the top of the menu bar, and each menu may have zero or more menu items, which are the drop-down list of items to choose from.

The command adds new menu item mA to a menu. The menu item is assigned to controller cB. If the player selects the menu item, the appropriate controller evaluation table entry is set to TRUE, which can then be tested by using the controller command.

Menu items are displayed under the menu in the order that they are added with the command. The first entry item determines the width of the entire menu box. If any later menu item entries are longer than the first, the menu window will not draw correctly. You should pad the first menu item entry enough spaces so it is at least as long as all other entries.

Additional information can be found in the Menus in AGI topic.

Possible Errors

Do not include a line break in a menu item; the extra lines will display on the line below the item, and will not automatically erase, unless covered up by another menu selection.


[ build a simple menu system"Info");"About   ", c0);"Help    ", c1);"File");"Save Game      <F5>", c2);"Restore Game   <F7>", c3);"-------------------", c20);"Restart Game   <F9>", c4);"-------------------", c20);"Quit        <Alt Z>", c5);
disable.item(c20);  [ disable the separators;      [ submit menu to agi

Technical Information

Required Interpreter Version: Available in version 2.272 and above.
Byte-Code Value: 157 (0x9D hex)

See Also

Player Input Commands
Menus in AGI