]> git.lizzy.rs Git - nothing.git/blob - src/game/sprite_font.h
5025963377ba4a52cc31ac872dcbe95e5dfebf5b
[nothing.git] / src / game / sprite_font.h
1 #ifndef SPRITE_FONT_H_
2 #define SPRITE_FONT_H_
3
4 #include "color.h"
5 #include "math/point.h"
6 #include "math/rect.h"
7
8 #define FONT_CHAR_WIDTH 7
9 #define FONT_CHAR_HEIGHT 9
10
11 typedef struct sprite_font_t sprite_font_t;
12
13 sprite_font_t *create_sprite_font_from_file(const char *bmp_file_path,
14                                             SDL_Renderer *renderer);
15 void destroy_sprite_font(sprite_font_t *sprite_font);
16
17 int sprite_font_render_text(const sprite_font_t *sprite_font,
18                             SDL_Renderer *renderer,
19                             vec_t position,
20                             vec_t size,
21                             color_t color,
22                             const char *text);
23
24 rect_t sprite_font_boundary_box(const sprite_font_t *sprite_font,
25                                 vec_t position,
26                                 vec_t size,
27                                 const char *text);
28
29 #endif  // SPRITE_FONT_H_