]> git.lizzy.rs Git - nothing.git/blobdiff - src/game/sprite_font.h
Merge pull request #621 from tsoding/615
[nothing.git] / src / game / sprite_font.h
index 1c9ab94726d11cb3877fa6e5e9ae831a86daeafe..0b71d74b63b9f95b4830c8b3eccb45a233905ebd 100644 (file)
@@ -3,18 +3,27 @@
 
 #include "color.h"
 #include "math/point.h"
+#include "math/rect.h"
 
-typedef struct sprite_font_t sprite_font_t;
+#define FONT_CHAR_WIDTH 7
+#define FONT_CHAR_HEIGHT 9
 
-sprite_font_t *create_sprite_font_from_file(const char *bmp_file_path,
+typedef struct Sprite_font Sprite_font;
+
+Sprite_font *create_sprite_font_from_file(const char *bmp_file_path,
                                             SDL_Renderer *renderer);
-void destroy_sprite_font(sprite_font_t *sprite_font);
+void destroy_sprite_font(Sprite_font *sprite_font);
 
-int sprite_font_render_text(const sprite_font_t *sprite_font,
+int sprite_font_render_text(const Sprite_font *sprite_font,
                             SDL_Renderer *renderer,
-                            vec_t position,
-                            int size,
-                            color_t color,
+                            Vec position,
+                            Vec size,
+                            Color color,
                             const char *text);
 
+Rect sprite_font_boundary_box(const Sprite_font *sprite_font,
+                                Vec position,
+                                Vec size,
+                                const char *text);
+
 #endif  // SPRITE_FONT_H_