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

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.
 

Detailed Description

Utility functions for rendering common UI elements.

Function Documentation

◆ render_button()

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.

Parameters
rendererThe SDL renderer used for drawing
fontThe TTF font used for rendering text
textThe text to display on the button
buttonThe rectangle defining the button's position and size
colorThe color of the text
rendererThe SDL renderer used for drawing
fontThe TTF font used for rendering text
textThe text to display on the button
buttonThe rectangle defining the button's position and size
colorThe color of the text