diff tests/test_font.nim @ 415:25db1fa56cb7

add: font/text improvments, support for newline rendering
author Sam <sam@basx.dev>
date Sat, 27 Jan 2024 00:31:11 +0700
parents 8fb4387b2ea1
children 73cca428e27a
line wrap: on
line diff
--- a/tests/test_font.nim	Thu Jan 25 20:23:22 2024 +0700
+++ b/tests/test_font.nim	Sat Jan 27 00:31:11 2024 +0700
@@ -27,8 +27,10 @@
           textbox.text = textbox.text & ($c).toRunes
         else:
           textbox.text = textbox.text & ($c).toRunes[0].toLower()
+    if engine.keyWasPressed(Enter):
+        textbox.text = textbox.text & Rune('\n')
     if engine.keyWasPressed(Space):
-        textbox.text = textbox.text & " ".toRunes[0]
+        textbox.text = textbox.text & Rune(' ')
     if engine.keyWasPressed(Backspace) and textbox.text.len > 0:
           textbox.text = textbox.text[0 ..< ^1]
     engine.renderScene(scene)