aboutsummaryrefslogtreecommitdiff
path: root/src/macroknight/text.hy
diff options
context:
space:
mode:
Diffstat (limited to 'src/macroknight/text.hy')
-rw-r--r--src/macroknight/text.hy8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/macroknight/text.hy b/src/macroknight/text.hy
new file mode 100644
index 0000000..1b631c1
--- /dev/null
+++ b/src/macroknight/text.hy
@@ -0,0 +1,8 @@
+(import tiles [draw-tile])
+
+(defn render-text [surf tileset text x y]
+ (for [#(char-num char) (enumerate text)]
+ (when (> (ord char) 32)
+ (let [sprite-num (+ (ord char)
+ (if (> (ord char) 77) 888 852))]
+ (draw-tile surf tileset sprite-num (+ x char-num) y)))))