Middle menu class with 3 buttons and 1 title.
More...
#include <page_3b_1t.hpp>
Middle menu class with 3 buttons and 1 title.
This class is a versatile menu that can be used for multiple purposes such as ball type selection or AI difficulty selection.
◆ page_3b_1t()
page_3b_1t::page_3b_1t |
( |
SDL_Renderer * | _renderer, |
|
|
TTF_Font * | font ) |
Constructor for the middle menu page.
- Parameters
-
_renderer | The SDL renderer to use for drawing |
font | The TTF font to use for text display |
Initializes the menu with three buttons and default settings
- Parameters
-
_renderer | The SDL renderer to use for drawing |
font | The TTF font to use for text display |
◆ ~page_3b_1t()
page_3b_1t::~page_3b_1t |
( |
| ) |
|
Destructor for the middle menu page.
Cleans up allocated resources
◆ action_handler()
bool page_3b_1t::action_handler |
( |
const SDL_Event & | event | ) |
|
Handles events for the menu buttons.
- Parameters
-
event | The SDL event to process |
- Returns
- true if a button was clicked, false otherwise
Processes SDL events to detect button hovers and clicks
- Parameters
-
event | The SDL event to process |
- Returns
- true if a button was clicked, false otherwise
◆ get_mode_type()
int page_3b_1t::get_mode_type |
( |
| ) |
const |
Gets the current mode type.
- Returns
- The current mode type ID
◆ get_selected_option()
int page_3b_1t::get_selected_option |
( |
| ) |
const |
Gets the currently selected option.
- Returns
- The selected button index (0-2), or -1 if none selected
◆ render_object()
void page_3b_1t::render_object |
( |
| ) |
|
Renders the middle menu.
Displays different options based on the current mode_type value
◆ set_mode_type()
void page_3b_1t::set_mode_type |
( |
int | type | ) |
|
Sets the mode type to display appropriate options.
- Parameters
-
type | The mode type ID to set |
◆ button_1
SDL_Rect page_3b_1t::button_1 |
|
private |
Rectangle for first option button
◆ button_2
SDL_Rect page_3b_1t::button_2 |
|
private |
Rectangle for second option button
◆ button_3
SDL_Rect page_3b_1t::button_3 |
|
private |
Rectangle for third option button
◆ mode_type
int page_3b_1t::mode_type |
|
private |
Mode type for determining what options to show
◆ police
TTF_Font* page_3b_1t::police |
|
private |
Font used for text rendering
◆ renderer
SDL_Renderer* page_3b_1t::renderer |
|
private |
Responsible for placing objects on the SDL screen
◆ selected_button
int page_3b_1t::selected_button |
|
private |
Currently selected button (-1 if none)
◆ texture_middle_menu
SDL_Texture* page_3b_1t::texture_middle_menu |
|
private |
Texture for the menu background
The documentation for this class was generated from the following files: