The NEW Pong Game V13.2.1
An interesting implemnettaion of the pong game
Loading...
Searching...
No Matches
page_2b_1t Class Reference

Notice screen with 2 buttons and 1 title. More...

#include <page_2b_1t.hpp>

Public Member Functions

bool action_handler (const SDL_Event &event)
 Handles events for the menu buttons.
 
bool get_go_back () const
 Checks if the "Back" button was pressed.
 
bool get_next_view () const
 Checks if the "Next" button was pressed.
 
int get_notice_id () const
 Gets the current notice ID.
 
 page_2b_1t (SDL_Renderer *_renderer, TTF_Font *font)
 Constructor for the notice page.
 
void render_object ()
 Renders the notice screen.
 
void set_notice_id (int _id)
 Sets the notice ID to display.
 
 ~page_2b_1t ()
 Destructor for the notice page.
 

Private Attributes

SDL_Rect button_back
 
SDL_Rect button_lets_go
 
bool go_back
 
bool next_view
 
int notice_id
 
TTF_Font * police
 
SDL_Renderer * renderer
 
SDL_Texture * texture_menu
 

Detailed Description

Notice screen with 2 buttons and 1 title.

This class handles the notice screen that displays game instructions and provides navigation buttons.

Constructor & Destructor Documentation

◆ page_2b_1t()

page_2b_1t::page_2b_1t ( SDL_Renderer * _renderer,
TTF_Font * font )

Constructor for the notice page.

Parameters
_rendererThe SDL renderer to use for drawing
fontThe TTF font to use for text display

Initializes the notice screen with navigation buttons

Parameters
_rendererThe SDL renderer to use for drawing
fontThe TTF font to use for text display

◆ ~page_2b_1t()

page_2b_1t::~page_2b_1t ( )

Destructor for the notice page.

Cleans up allocated resources

Member Function Documentation

◆ action_handler()

bool page_2b_1t::action_handler ( const SDL_Event & event)

Handles events for the menu buttons.

Handles events for the notice screen buttons.

Parameters
eventThe SDL event to process
Returns
true if a button was clicked, false otherwise

Processes SDL events to detect button clicks

Parameters
eventThe SDL event to process
Returns
true if a button was clicked, false otherwise

◆ get_go_back()

bool page_2b_1t::get_go_back ( ) const

Checks if the "Back" button was pressed.

Returns
true if the game should go back to the modes menu, false otherwise

◆ get_next_view()

bool page_2b_1t::get_next_view ( ) const

Checks if the "Next" button was pressed.

Returns
true if the game should proceed to the next view, false otherwise

◆ get_notice_id()

int page_2b_1t::get_notice_id ( ) const

Gets the current notice ID.

Returns
The current notice ID to display appropriate text

◆ render_object()

void page_2b_1t::render_object ( )

Renders the notice screen.

Displays different notice text based on the current notice_id and renders the navigation buttons

Select notice text based on notice_id

Different game modes have different instructions that are displayed based on the currently selected notice_id

◆ set_notice_id()

void page_2b_1t::set_notice_id ( int _id)

Sets the notice ID to display.

Parameters
_idThe new notice ID to display

Member Data Documentation

◆ button_back

SDL_Rect page_2b_1t::button_back
private

Rectangle for "Back" button

◆ button_lets_go

SDL_Rect page_2b_1t::button_lets_go
private

Rectangle for "Let's go" button

◆ go_back

bool page_2b_1t::go_back
private

Flag to go back to the mode selection menu

◆ next_view

bool page_2b_1t::next_view
private

Flag to proceed to the next view

◆ notice_id

int page_2b_1t::notice_id
private

ID for the current notice text to display

◆ police

TTF_Font* page_2b_1t::police
private

Font used for text rendering

◆ renderer

SDL_Renderer* page_2b_1t::renderer
private

Responsible for placing the objects on the SDL screen

◆ texture_menu

SDL_Texture* page_2b_1t::texture_menu
private

Texture for the menu background


The documentation for this class was generated from the following files: