Lays text out and returns its width in pixels. draw_prepared_text then draws it.
- font: the font to lay the text out in.
- text: UTF-8.
- effect_flags:
Font_Effectsflags.
font := load_font("", "Roboto-Regular.ttf", 24);
width := prepare_text(font, "Game over");
draw_prepared_text(font, (800 - width) / 2, 300); // centredThis one is only checked to compile, not run.
prepare_text :: (
font: *Dynamic_Font,
text: string,
effect_flags: Font_Effects = 0
) -> width: s64
Lays text out and returns its width in pixels. draw_prepared_text then draws it.
Parameters
- font: *Dynamic_Font
- the font to lay the text out in.
- text: string
- UTF-8.
- effect_flags: Font_Effects = 0
Font_Effectsflags.
Returns
- width: s64
font := load_font("", "Roboto-Regular.ttf", 24);
width := prepare_text(font, "Game over");
draw_prepared_text(font, (800 - width) / 2, 300); // centredThis one is only checked to compile, not run.