summaryrefslogtreecommitdiff
path: root/font.c
diff options
context:
space:
mode:
Diffstat (limited to 'font.c')
-rw-r--r--font.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/font.c b/font.c
index c077de2..7c4abd4 100644
--- a/font.c
+++ b/font.c
@@ -10,3 +10,13 @@ int font_init(const char *path)
return 1;
return 0;
}
+
+void font_draw(int x, int y, const char *s)
+{
+ for (; *s != '\0'; s++) {
+ const int ix = *s % 16 * 8;
+ const int iy = *s / 16 * 16;
+ TZR_DrawImage(___font_spr, x*8, y*16, ix, iy, 8, 16);
+ x += 1;
+ }
+}