OCRudoku  v1.0
Resolve word grid with ease
Loading...
Searching...
No Matches
EZ_text_input.c File Reference
#include <err.h>
#include "EZ_text_input.h"
Include dependency graph for EZ_text_input.c:

Functions

void EZ_process_text_input (SDL_Window *window, SDL_Renderer *renderer, SDL_Event *event, EZ_INTERACTIBLE *inter, void *data)
 Processes textinput events for an EZ_text_input.
 
EZ_text_inputEZ_create_text_input (char *back_img, TTF_Font *font, SDL_Color color, size_t max_length, input_type type, SDL_Renderer *renderer, anchore_point dst_anchore)
 Creates an EZ_text_input with the specified background image and anchoring point.
 

Function Documentation

◆ EZ_create_text_input()

EZ_text_input * EZ_create_text_input ( char * back_img,
TTF_Font * font,
SDL_Color color,
size_t max_length,
input_type type,
SDL_Renderer * renderer,
anchore_point dst_anchore )

Creates an EZ_text_input with the specified background image and anchoring point.

This function loads an image from the specified file path, creates an SDL texture from it, and initializes an EZ_text_input structure with the given renderer and anchoring point.

Parameters
back_imgThe file path to the background image for the textinput.
rendererThe SDL_Renderer used for rendering the textinput.
dst_anchoreThe anchoring point for the textinput.
Returns
A pointer to the newly created EZ_text_input.

◆ EZ_process_text_input()

void EZ_process_text_input ( SDL_Window * window,
SDL_Renderer * renderer,
SDL_Event * event,
EZ_INTERACTIBLE * inter,
void * data )

Processes textinput events for an EZ_text_input.

This function handles SDL mouse textinput events for an EZ_text_input. It checks if the left mouse textinput is pressed down or released while over the textinput, and triggers the appropriate callbacks if set.

Parameters
windowThe SDL_Window where the textinput is rendered.
rendererThe SDL_Renderer used for rendering.
eventThe SDL_Event containing the event data.
interThe EZ_INTERACTIBLE associated with the textinput.
dataA pointer to the EZ_text_input data.