The NEW Pong Game V13.2.1
An interesting implemnettaion of the pong game
Loading...
Searching...
No Matches
page_3b_1t.hpp
Go to the documentation of this file.
1
8#ifndef MIDDLE_MENU_HPP
9#define MIDDLE_MENU_HPP
10
11#include <SDL.h>
12#include <SDL_ttf.h>
13#include <array>
14#include <SDL_mixer.h>
15
16class Game;
17
26{
27private:
31 SDL_Texture *texture_middle_menu;
32 SDL_Renderer *renderer;
33 TTF_Font *police;
35 SDL_Rect button_1;
36 SDL_Rect button_2;
37 SDL_Rect button_3;
39public:
45 page_3b_1t(SDL_Renderer *_renderer, TTF_Font *font);
46
51
56 int get_selected_option() const { return selected_button; }
57
63 bool action_handler(const SDL_Event &event);
64
68 void render_object();
69
74 int get_mode_type() const { return mode_type; }
75
80 void set_mode_type(int type) { mode_type = type; }
81};
82
83#endif // MIDDLE_MENU_HPP
Definition game.hpp:53
Middle menu class with 3 buttons and 1 title.
Definition page_3b_1t.hpp:26
~page_3b_1t()
Destructor for the middle menu page.
Definition page_3b_1t.cpp:40
bool action_handler(const SDL_Event &event)
Handles events for the menu buttons.
Definition page_3b_1t.cpp:58
SDL_Rect button_2
Definition page_3b_1t.hpp:36
SDL_Rect button_3
Definition page_3b_1t.hpp:37
int selected_button
Definition page_3b_1t.hpp:28
SDL_Texture * texture_middle_menu
Definition page_3b_1t.hpp:31
void render_object()
Renders the middle menu.
Definition page_3b_1t.cpp:111
page_3b_1t(SDL_Renderer *_renderer, TTF_Font *font)
Constructor for the middle menu page.
Definition page_3b_1t.cpp:24
int get_mode_type() const
Gets the current mode type.
Definition page_3b_1t.hpp:74
SDL_Renderer * renderer
Definition page_3b_1t.hpp:32
TTF_Font * police
Definition page_3b_1t.hpp:33
int get_selected_option() const
Gets the currently selected option.
Definition page_3b_1t.hpp:56
void set_mode_type(int type)
Sets the mode type to display appropriate options.
Definition page_3b_1t.hpp:80
int mode_type
Definition page_3b_1t.hpp:29
SDL_Rect button_1
Definition page_3b_1t.hpp:35
TTF_Font * font
Definition letter_test.cpp:24