examples: make draw_static_text.v show the font name too, for easier comparisons

This commit is contained in:
Delyan Angelov 2024-08-22 12:38:42 +03:00
parent e6b8162bfa
commit 3f8e92bc6d
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED

View File

@ -34,11 +34,12 @@ pub mut:
fn my_init(mut app App_data) { fn my_init(mut app App_data) {
app.init_flag = true app.init_flag = true
texts := ['Hello', block_txt]! texts := ['Hello, font: ${os.file_name(custom_font_path)}', block_txt]!
dump(texts[0])
for i in 0 .. 2 { for i in 0 .. 2 {
mut txt := unsafe { &app.ttf_render[i] } mut txt := unsafe { &app.ttf_render[i] }
txt.destroy_texture() txt.destroy_texture()
txt.create_text_block(texts[i], 600, 600, 24 + (1 - i) * 24) txt.create_text_block(texts[i], 600, 600, 24)
txt.create_texture() txt.create_texture()
} }
} }