![]() |
The NEW Pong Game V13.2.1
An interesting implemnettaion of the pong game
|
Utility functions for rendering common UI elements. More...
Functions | |
void | render_button (SDL_Renderer *renderer, TTF_Font *font, const char *text, const SDL_Rect &button, const SDL_Color &color) |
Renders a text button on screen. | |
Utility functions for rendering common UI elements.
void Utilities::render_button | ( | SDL_Renderer * | renderer, |
TTF_Font * | font, | ||
const char * | text, | ||
const SDL_Rect & | button, | ||
const SDL_Color & | color ) |
Renders a text button on screen.
Creates a text surface, converts it to a texture, and renders it centered on the provided button rectangle.
renderer | The SDL renderer used for drawing |
font | The TTF font used for rendering text |
text | The text to display on the button |
button | The rectangle defining the button's position and size |
color | The color of the text |
renderer | The SDL renderer used for drawing |
font | The TTF font used for rendering text |
text | The text to display on the button |
button | The rectangle defining the button's position and size |
color | The color of the text |