Difference between revisions of "AGI Command Reference - Menu Management Commands"

From AGI Wiki
Jump to navigationJump to search
Line 11: Line 11:
 
[[AGI Command Reference - Object Motion Control Commands|6]] |  
 
[[AGI Command Reference - Object Motion Control Commands|6]] |  
 
[[AGI Command Reference - Inventory Item Management Commands|7]] |  
 
[[AGI Command Reference - Inventory Item Management Commands|7]] |  
[[AGI Command Reference - Picture Resource Management Commands|8]] |  
+
[[AGI Command Reference - PIC Resource Management Commands|8]] |  
 
[[AGI Command Reference - Sound Resource Management Commands|9]] |  
 
[[AGI Command Reference - Sound Resource Management Commands|9]] |  
 
[[AGI Command Reference - Text Management Commands|10]] |  
 
[[AGI Command Reference - Text Management Commands|10]] |  
Line 80: Line 80:
 
[[AGI Command Reference - Object Motion Control Commands|6]] |  
 
[[AGI Command Reference - Object Motion Control Commands|6]] |  
 
[[AGI Command Reference - Inventory Item Management Commands|7]] |  
 
[[AGI Command Reference - Inventory Item Management Commands|7]] |  
[[AGI Command Reference - Picture Resource Management Commands|8]] |  
+
[[AGI Command Reference - PIC Resource Management Commands|8]] |  
 
[[AGI Command Reference - Sound Resource Management Commands|9]] |  
 
[[AGI Command Reference - Sound Resource Management Commands|9]] |  
 
[[AGI Command Reference - Text Management Commands|10]] |  
 
[[AGI Command Reference - Text Management Commands|10]] |  

Revision as of 20:59, 25 December 2013

Tutorials Table of Contents
AGI Command Reference Index

Page: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16


Menu Management Commands
By Chris Cromer

 

Creating your program, you can offer the player a choice using a system of menus. These may be short one-line questions (menu header) with several answers (menu elements), or a prompt to change some of the system parameters, for example, object movement speed. Let us consider these commands.

 

set.menu(n);

Message n is used as the header of the menu elements which follow.

set.menu.item(n, c);

Message n is used as a menu element, where c is this element's code (a number between 0 and 255).

submit.menu();

Ends menu creation.

enable.item(c); disable.item(c);

Enables or disables a menu item with the code c.

               |-------- heading
               v
           -------------------------------
           | File                        |
           -------------------------------
Menu   -- >| Save       |
Element    |------------|
           | Restore    |
           |------------|
           |XXXXXXXXXXXX| < - menu element disabled
           |------------|   using disable.item
           | Quit       |
           --------------

menu.input();

If Flag(14) = 1, a menu system is shown on the screen, allowing the user to choose an item. Whether an item with the code c has been chosen can be tested using a command 'controller (c)', where c is the code assigned to the menu item.

 

Page: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16


Tutorials Table of Contents
AGI Command Reference Index

< Previous: Initialization CommandsNext: Test Commands >