Main menu class with 3 buttons and no title.
More...
#include <page_3b_0t.hpp>
|
| bool | action_handler (const SDL_Event &event) |
| | Handles events for the menu buttons.
|
| |
| bool | get_continue_game () const |
| | Checks if the continue game button was pressed.
|
| |
| bool | get_exit_mode () const |
| | Checks if the exit button was pressed.
|
| |
| bool | get_saved_file_exists () const |
| | Checks if a saved game file exists.
|
| |
| bool | get_started () const |
| | Checks if the start new game button was pressed.
|
| |
| | page_3b_0t (SDL_Renderer *_renderer, TTF_Font *font) |
| | Constructor for the main menu page.
|
| |
| void | render_object (int mode, const std::string &highscore_name, int highscore) |
| | Renders the main menu.
|
| |
| void | set_saved_file_exists () |
| | Updates the saved file exists flag.
|
| |
| | ~page_3b_0t () |
| | Destructor for the main menu page.
|
| |
Main menu class with 3 buttons and no title.
This class implements the main menu screen with options to start a new game, continue a saved game, or exit to the mode selection screen.
◆ page_3b_0t()
| page_3b_0t::page_3b_0t |
( |
SDL_Renderer * | _renderer, |
|
|
TTF_Font * | font ) |
Constructor for the main menu page.
- Parameters
-
| _renderer | The SDL renderer to use for drawing |
| font | The TTF font to use for text display |
Initializes the menu with buttons and checks for existing saved games
- Parameters
-
| _renderer | The SDL renderer to use for drawing |
| font | The TTF font to use for text display |
◆ ~page_3b_0t()
| page_3b_0t::~page_3b_0t |
( |
| ) |
|
Destructor for the main menu page.
Cleans up allocated resources
◆ action_handler()
| bool page_3b_0t::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 clicks
- Parameters
-
| event | The SDL event to process |
- Returns
- true if a button was clicked, false otherwise
◆ get_continue_game()
| bool page_3b_0t::get_continue_game |
( |
| ) |
const |
Checks if the continue game button was pressed.
- Returns
- true if should continue a saved game, false otherwise
◆ get_exit_mode()
| bool page_3b_0t::get_exit_mode |
( |
| ) |
const |
Checks if the exit button was pressed.
- Returns
- true if should exit to mode selection, false otherwise
◆ get_saved_file_exists()
| bool page_3b_0t::get_saved_file_exists |
( |
| ) |
const |
Checks if a saved game file exists.
- Returns
- true if a saved game exists, false otherwise
◆ get_started()
| bool page_3b_0t::get_started |
( |
| ) |
const |
Checks if the start new game button was pressed.
- Returns
- true if a new game should be started, false otherwise
◆ render_object()
| void page_3b_0t::render_object |
( |
int | mode, |
|
|
const std::string & | highscore_name, |
|
|
int | highscore ) |
Renders the main menu.
- Parameters
-
| mode | Current game mode |
| highscore_name | Name of the player with highest score |
| highscore | The highest score value |
Displays the menu buttons and high score information if available
- Parameters
-
| mode | Current game mode |
| highscore_name | Name of the player with highest score |
| highscore | The highest score value |
◆ set_saved_file_exists()
| void page_3b_0t::set_saved_file_exists |
( |
| ) |
|
Updates the saved file exists flag.
◆ button_continue
| SDL_Rect page_3b_0t::button_continue |
|
private |
Rectangle for continueing game button
◆ button_exit
| SDL_Rect page_3b_0t::button_exit |
|
private |
◆ button_start
| SDL_Rect page_3b_0t::button_start |
|
private |
Rectangle for start new game
◆ continue_game
| bool page_3b_0t::continue_game |
|
private |
Flag for continuing a saved game
◆ exit_mode
| bool page_3b_0t::exit_mode |
|
private |
Flag for exiting to mode selection
◆ police
| TTF_Font* page_3b_0t::police |
|
private |
Font used for text rendering
◆ renderer
| SDL_Renderer* page_3b_0t::renderer |
|
private |
Responsible for placing objects on the SDL screen
◆ saved_file_exists
| bool page_3b_0t::saved_file_exists |
|
private |
Whether a saved game file exists
◆ start_new_game
| bool page_3b_0t::start_new_game |
|
private |
Flag for starting a new game
◆ texture_menu
| SDL_Texture* page_3b_0t::texture_menu |
|
private |
Texture for the menu background
The documentation for this class was generated from the following files: