Menu
src.view.menu
¶
Menu rendering layer.
The menu view draws the main menu, hero selection interface, and settings screen.
It delegates event interpretation and selection state updates to MenuHandler.
The documentation follows Google-style docstrings so tools such as pdoc, Sphinx Napoleon, or MkDocs-based pipelines can expose parameters, return values, and side effects in a consistent HTML API reference.
Menu
¶
Pygame rendering layer for the start, selection, and settings menus.
Attributes:
| Name | Type | Description |
|---|---|---|
settings |
Settings
|
Shared application settings. |
screen |
Screen
|
Display wrapper used for rendering. |
Notes
This class is documented as part of the public project API and is intended to be readable in generated HTML documentation.
Source code in src\view\menu.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | |
start(menu_handler)
¶
Create menu assets and return the selected units after the setup loop.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
menu_handler
|
MenuHandler used to process menu events and selections. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
object |
The value produced by the menu or game loop, when one is returned by the underlying flow. |
Side Effects
Runs menu or game loops and may initialize runtime state.
Source code in src\view\menu.py
menu(pressed, screen, banner, menu_handler)
¶
Draw the main menu and delegate menu input handling.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pressed
|
Current keyboard state returned by Pygame. |
required | |
screen
|
Pygame surface or screen wrapper used as the drawing target. |
required | |
banner
|
Menu banner surface or rectangle used by the menu screen. |
required | |
menu_handler
|
MenuHandler used to process menu events and selections. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
None |
This method is executed for its side effects. |
Side Effects
Handles menu events, screen transitions, and display refresh.
Source code in src\view\menu.py
choose_player(screen, banner, menu_handler)
¶
Draw the player and hero selection screen.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
screen
|
Pygame surface or screen wrapper used as the drawing target. |
required | |
banner
|
Menu banner surface or rectangle used by the menu screen. |
required | |
menu_handler
|
MenuHandler used to process menu events and selections. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
None |
This method is executed for its side effects. |
Side Effects
Processes player naming, hero selection, and confirmation events.
Source code in src\view\menu.py
display_settings()
¶
Draw the display settings screen.
Returns:
| Name | Type | Description |
|---|---|---|
None |
This method is executed for its side effects. |
Side Effects
Applies settings-screen events and may update display resolution.