![]() |
The NEW Pong Game V13.2.1
An interesting implemnettaion of the pong game
|
Utility class providing user interface functionality. More...
#include <gui.hpp>
Static Public Member Functions | |
static std::string | player_name_input (SDL_Renderer *renderer, TTF_Font *font, int player_number) |
Gets the player's name input from the SDL window. | |
Utility class providing user interface functionality.
This class contains static methods for handling UI elements and user interactions throughout the game.
|
static |
Gets the player's name input from the SDL window.
Displays an input field for a player to enter their name.
This function handles SDL events to capture the player's name input from the keyboard. It displays the input text on screen and updates it in real-time as the player types.
renderer | The SDL renderer used for drawing |
font | The TTF font used to render text |
player_number | The player number (for display purposes) |
This function creates an SDL window with an input field where the player can type their name. It manages all input events and rendering.
renderer | The SDL renderer to use for drawing |
font | The TTF font to use for text display |
player_number | The player number (for display purposes) |
Define UI element positions and dimensions Centers the input field and instruction text on screen
Initialize the white background
Main input loop Processes keyboard events and updates the display
Render the instruction text
Render the input text
Cleanup resources before returning