Add support for rendering text with a bitmap font
This commit is contained in:
1 parent
7ec35a0b27
commit
fe427689cf
2 files changed
+91
-22
No files matched your search
+12
-5
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "AssetManager.h"
|
||||
#include "Renderer.h"
|
||||
#include "SDL_pixels.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -10,13 +11,19 @@ extern "C" {
|
||||
|
||||
typedef struct bitmap_font BitmapFont;
|
||||
|
||||
BitmapFont *load_bitmap_font(AssetManager *am, const Renderer *renderer,
|
||||
const char *filepath, u64 tile_width,
|
||||
u64 tile_height);
|
||||
BitmapFont *create_bitmap_font(AssetManager *am, const Renderer *renderer,
|
||||
const char *filepath, u64 tile_width,
|
||||
u64 tile_height);
|
||||
|
||||
RenderRect get_character_sprite(BitmapFont *font, u64 index);
|
||||
TextSize get_text_size_from_bitmap_font(BitmapFont *font, u64 font_size,
|
||||
const char *text);
|
||||
|
||||
void unload_bitmap_font(AssetManager *am, BitmapFont **font);
|
||||
void render_bitmap_font_text(AssetManager *am, Renderer *renderer,
|
||||
BitmapFont *font, u64 font_size, const char *text,
|
||||
u64 start_index, RenderRect dst_rect,
|
||||
SDL_Color text_color);
|
||||
|
||||
void destroy_bitmap_font(AssetManager *am, BitmapFont **font);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user