]> git.lizzy.rs Git - nothing.git/blob - src/game/sprite_font.h
(#964) Make LabelLayer display the ids
[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 Sprite_font;
12
13 Sprite_font *create_sprite_font_from_file(const char *bmp_file_path,
14                                             SDL_Renderer *renderer);
15 void destroy_sprite_font(Sprite_font *sprite_font);
16
17 int sprite_font_render_text(const Sprite_font *sprite_font,
18                             SDL_Renderer *renderer,
19                             Vec position,
20                             Vec size,
21                             Color color,
22                             const char *text);
23
24 Rect sprite_font_boundary_box(const Sprite_font *sprite_font,
25                               Vec position,
26                               Vec size,
27                               const char *text);
28
29 #endif  // SPRITE_FONT_H_