Mercurial > games > semicongine
comparison tests/test_font.nim @ 883:98b66663e07c
add: text-wrapping, fix: incorrect descriptor poolsizes
| author | Sam <sam@basx.dev> |
|---|---|
| date | Wed, 31 Jan 2024 00:29:40 +0700 |
| parents | 11a55a45aba2 |
| children | 1e3c242435af |
comparison
equal
deleted
inserted
replaced
| 882:5392cbd9db41 | 883:98b66663e07c |
|---|---|
| 10 | 10 |
| 11 # build scene | 11 # build scene |
| 12 var scene = Scene(name: "main") | 12 var scene = Scene(name: "main") |
| 13 # var font = loadFont("DejaVuSans.ttf", lineHeightPixels=90'f32, charset="abcdefghijklmnopqrstuvwxyz ".toRunes) | 13 # var font = loadFont("DejaVuSans.ttf", lineHeightPixels=90'f32, charset="abcdefghijklmnopqrstuvwxyz ".toRunes) |
| 14 var font = loadFont("DejaVuSans.ttf", lineHeightPixels = 210'f32) | 14 var font = loadFont("DejaVuSans.ttf", lineHeightPixels = 210'f32) |
| 15 var main_text = font.initText("", 32, color = newVec4f(1, 0.15, 0.15, 1), scale = 0.001) | 15 var main_text = font.initText("", maxLen = 255, color = newVec4f(1, 0.15, 0.15, 1), scale = 0.0005, maxWidth = 1.0) |
| 16 var help_text = font.initText("""Controls | 16 var help_text = font.initText("""Controls |
| 17 | 17 |
| 18 Horizontal alignment: | 18 Horizontal alignment: |
| 19 F1: Left | 19 F1: Left |
| 20 F2: Center | 20 F2: Center |
