ic-explorer/textbox.h

33 lines
744 B
C

#ifndef IC_EXPLORER_TEXTBOX_H
#define IC_EXPLORER_TEXTBOX_H
#include "window.h"
#include <SDL_ttf.h>
#define TEXT_BOX_PADDING 0.005f
typedef struct {
float x;
float y;
float textSize;
SDL_Color textColor;
SDL_Texture *background;
TTF_Font *font;
char *text;
size_t lineCount;
SDL_Texture **renderedText;
} TextBox;
TextBox *textBoxNew(const char *text, float x, float y, float textSize,
SDL_Color color, SDL_Texture *background, TTF_Font *font,
const Window *window);
void textBoxDelete(TextBox *textBox);
void textBoxDraw(TextBox *textBox, const Window *window);
void textBoxUpdate(TextBox *textBox, const Window *window);
#endif /* IC_EXPLORER_TEXTBOX_H */