OCRudoku
v1.0
Resolve word grid with ease
|
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#include <SDL2/SDL_ttf.h>
#include "../EZ_utils.h"
#include "../../Rendering/RenderingUtils.h"
Go to the source code of this file.
Data Structures | |
struct | EZ_text |
Functions | |
EZ_text * | EZ_create_text (char *text, TTF_Font *font, SDL_Color color, SDL_Renderer *renderer, anchore_point dst_anchore, int auto_aspect) |
Creates an EZ_text object with the given parameters. | |
void | EZ_change_text (EZ_text *text_obj, char *text, TTF_Font *font, SDL_Color color, SDL_Renderer *renderer, int auto_aspect) |
Changes the text of an existing EZ_text object. | |
void EZ_change_text | ( | EZ_text * | text_obj, |
char * | text, | ||
TTF_Font * | font, | ||
SDL_Color | color, | ||
SDL_Renderer * | renderer, | ||
int | auto_aspect ) |
Changes the text of an existing EZ_text object.
This function updates the text of an existing EZ_text object. It creates a new surface and texture from the provided text, font, and color, and updates the EZ_text object with the new texture and source rectangle. If auto_aspect is non-zero, the aspect ratio of the destination anchore will be automatically set based on the new surface dimensions.
text_obj | The EZ_text object to be updated. |
text | The new text to be rendered. |
font | The TTF_Font to be used for rendering the new text. |
color | The SDL_Color to be used for the new text. |
renderer | The SDL_Renderer to be used for creating the new texture. |
auto_aspect | If non-zero, the aspect ratio of the destination anchore will be automatically set based on the new surface dimensions. |
EZ_text * EZ_create_text | ( | char * | text, |
TTF_Font * | font, | ||
SDL_Color | color, | ||
SDL_Renderer * | renderer, | ||
anchore_point | dst_anchore, | ||
int | auto_aspect ) |
Creates an EZ_text object with the given parameters.
This function creates an EZ_text object, which includes rendering the text to a surface and creating a texture from that surface. The resulting texture is then used to create an EZ_DRAWABLE structure, which is stored in the EZ_text object.
text | The text to be rendered. |
font | The TTF_Font to be used for rendering the text. |
color | The SDL_Color to be used for the text. |
renderer | The SDL_Renderer to be used for creating the texture. |
dst_anchore | The anchore_point for the destination. |
auto_aspect | If non-zero, the aspect ratio of the destination anchore will be automatically set based on the surface dimensions. |