From cee75e57560b77e8ec0a394c1d3c98b9839be80e Mon Sep 17 00:00:00 2001 From: Gene Pasquet Date: Thu, 15 May 2025 13:46:26 +0200 Subject: Refactor!! --- src/macroknight/text.hy | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 src/macroknight/text.hy (limited to 'src/macroknight/text.hy') 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))))) -- cgit v1.2.3