Mercurial > games > semicongine
comparison tests/test_text.nim @ 1329:ad09d41abd1e
add: 2d-scaling for text
author | sam <sam@basx.dev> |
---|---|
date | Sat, 17 Aug 2024 16:09:15 +0700 |
parents | 373a4888f6ac |
children | df3c075e5dea |
comparison
equal
deleted
inserted
replaced
1328:a53a31b6e027 | 1329:ad09d41abd1e |
---|---|
211 ) | 211 ) |
212 | 212 |
213 var labels: seq[Textbox] | 213 var labels: seq[Textbox] |
214 var positions = newSeq[Vec3f](100) | 214 var positions = newSeq[Vec3f](100) |
215 var colors = newSeq[Vec4f](100) | 215 var colors = newSeq[Vec4f](100) |
216 var scales = newSeq[float32](100) | 216 var scales = newSeq[Vec2f](100) |
217 for i in 0 ..< 100: | 217 for i in 0 ..< 100: |
218 positions[i] = vec3(rand(-0.5 .. 0.5), rand(-0.5 .. 0.5), rand(-0.1 .. 0.1)) | 218 positions[i] = vec3(rand(-0.5 .. 0.5), rand(-0.5 .. 0.5), rand(-0.1 .. 0.1)) |
219 colors[i] = vec4(rand(0.5 .. 1.0), rand(0.5 .. 1.0), rand(0.5 .. 1.0), rand(0.5 .. 1.0)) | 219 colors[i] = vec4(rand(0.5 .. 1.0), rand(0.5 .. 1.0), rand(0.5 .. 1.0), rand(0.5 .. 1.0)) |
220 scales[i] = rand(0.5'f32 .. 1.5'f32) | 220 scales[i] = vec2(rand(0.5'f32 .. 1.5'f32), rand(0.5'f32 .. 1.5'f32)) |
221 labels.add initTextbox( | 221 labels.add initTextbox( |
222 renderdata, | 222 renderdata, |
223 pipeline.layout(0), | 223 pipeline.layout(0), |
224 font, | 224 font, |
225 0.001, | 225 0.001, |