ableos/sysdata/programs/render_example/src/examples/text.hb

22 lines
618 B
Plaintext
Raw Normal View History

2024-10-26 03:23:28 -05:00
.{Vec2, sin, cos} := @use("../../../../libraries/stn/src/lib.hb").math
render := @use("../../../../libraries/render/src/lib.hb")
/* expected result:
words */
psf := @embed("../../../../consolefonts/tamsyn/10x20r.psf")
example := fn(): void {
screen := render.init(true)
font := render.text.font_from_psf2(@bitcast(&psf))
t := 0
2024-11-01 13:09:12 -05:00
str := "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX\0"
2024-10-26 03:23:28 -05:00
loop {
render.clear(screen, render.black)
render.put_text(screen, font, .(t, t % screen.height), render.red, str)
render.sync(screen)
2024-11-01 13:09:12 -05:00
// t += 1
2024-10-26 03:23:28 -05:00
}
return
}