Difference between revisions of "Modules/game menu"
From MSX Game Library
< Modules
(→Settings) |
(→Settings) |
||
Line 7: | Line 7: | ||
== Settings == | == Settings == | ||
Modules can be customized into the project's <tt>msxgl_config.h</tt> file to fullfill your needs: | Modules can be customized into the project's <tt>msxgl_config.h</tt> file to fullfill your needs: | ||
− | #define MENU_USE_DEFAULT_CALLBACK TRUE // Use default input/print callback | + | #define MENU_USE_DEFAULT_CALLBACK TRUE // Use default input/print callback |
− | #define MENU_SCREEN_WIDTH | + | #define MENU_SCREEN_WIDTH MENU_VARIABLE // Screen width |
− | #define MENU_FRAME_X | + | #define MENU_FRAME_X 0 // Frame position X |
− | #define MENU_FRAME_Y | + | #define MENU_FRAME_Y 6 // Frame position Y |
− | #define MENU_FRAME_WIDTH | + | #define MENU_FRAME_WIDTH 32 // Frame width |
− | #define MENU_FRAME_HEIGHT | + | #define MENU_FRAME_HEIGHT 8 // Frame height |
− | #define MENU_CHAR_CLEAR | + | #define MENU_CHAR_CLEAR '\0' // Clear character |
− | #define MENU_CHAR_CURSOR | + | #define MENU_CHAR_CURSOR '@' // Cursor character |
− | #define MENU_CHAR_TRUE | + | #define MENU_CHAR_TRUE 'O' // True character |
− | #define MENU_CHAR_FALSE | + | #define MENU_CHAR_FALSE 'X' // False character |
− | #define MENU_CHAR_LEFT | + | #define MENU_CHAR_LEFT '<' // Left edit character |
− | #define MENU_CHAR_RIGHT | + | #define MENU_CHAR_RIGHT '>' // Right edit character |
− | #define MENU_TITLE_X | + | #define MENU_TITLE_X 4 // Title position X |
− | #define MENU_TITLE_Y | + | #define MENU_TITLE_Y 6 // Title position Y |
− | #define MENU_ITEM_X | + | #define MENU_ITEM_X 6 // Item label X position |
− | #define MENU_ITEM_Y | + | #define MENU_ITEM_Y 8 // Item label X position |
− | #define MENU_ITEM_X_GOTO | + | #define MENU_ITEM_X_GOTO 6 // Goto type item label X position |
− | #define MENU_ITEM_ALIGN | + | #define MENU_ITEM_ALIGN MENU_ITEM_ALIGN_LEFT // Item label alignment |
− | #define MENU_ITEM_ALIGN_GOTO | + | #define MENU_ITEM_ALIGN_GOTO ENU_ITEM_ALIGN_LEFT // Goto type item label alignment |
− | #define MENU_VALUE_X | + | #define MENU_VALUE_X 14 // Item value X position |
// Type of cursor | // Type of cursor | ||
− | // - MENU_CURSOR_MODE_NONE | + | // - MENU_CURSOR_MODE_NONE No cursor |
− | // - MENU_CURSOR_MODE_CHAR | + | // - MENU_CURSOR_MODE_CHAR Character cursor |
− | // - MENU_CURSOR_MODE_SPRT | + | // - MENU_CURSOR_MODE_SPRT Sprite cursor |
− | #define MENU_CURSOR_MODE | + | #define MENU_CURSOR_MODE MENU_CURSOR_MODE_CHAR |
− | #define MENU_CURSOR_OFFSET | + | #define MENU_CURSOR_OFFSET (-2) // Cursor X position offset |
== Usage == | == Usage == |
Revision as of 23:29, 31 October 2023
The game_menu module automatically manages menus based on tables representing each page and its interactions.
Dependencies
Settings
Modules can be customized into the project's msxgl_config.h file to fullfill your needs:
#define MENU_USE_DEFAULT_CALLBACK TRUE // Use default input/print callback #define MENU_SCREEN_WIDTH MENU_VARIABLE // Screen width #define MENU_FRAME_X 0 // Frame position X #define MENU_FRAME_Y 6 // Frame position Y #define MENU_FRAME_WIDTH 32 // Frame width #define MENU_FRAME_HEIGHT 8 // Frame height #define MENU_CHAR_CLEAR '\0' // Clear character #define MENU_CHAR_CURSOR '@' // Cursor character #define MENU_CHAR_TRUE 'O' // True character #define MENU_CHAR_FALSE 'X' // False character #define MENU_CHAR_LEFT '<' // Left edit character #define MENU_CHAR_RIGHT '>' // Right edit character #define MENU_TITLE_X 4 // Title position X #define MENU_TITLE_Y 6 // Title position Y #define MENU_ITEM_X 6 // Item label X position #define MENU_ITEM_Y 8 // Item label X position #define MENU_ITEM_X_GOTO 6 // Goto type item label X position #define MENU_ITEM_ALIGN MENU_ITEM_ALIGN_LEFT // Item label alignment #define MENU_ITEM_ALIGN_GOTO ENU_ITEM_ALIGN_LEFT // Goto type item label alignment #define MENU_VALUE_X 14 // Item value X position // Type of cursor // - MENU_CURSOR_MODE_NONE No cursor // - MENU_CURSOR_MODE_CHAR Character cursor // - MENU_CURSOR_MODE_SPRT Sprite cursor #define MENU_CURSOR_MODE MENU_CURSOR_MODE_CHAR #define MENU_CURSOR_OFFSET (-2) // Cursor X position offset
Usage
Annexe
- See also: Sample program s_menu
Documentation