al_draw_text(3)
π al_draw_text(3) β Allegro 5 API β¨
okay bestie, so this one lives in the Allegro 5 API reference manual (Library Functions Manual, no cap) and it's literally the glow-up moment for putting words on your screen π
πΈ SYNOPSIS πΈ
#include <allegro5/allegro_font.h>
void al_draw_text(const ALLEGRO_FONT *font,
ALLEGRO_COLOR color, float x, float y, int flags,
char const *text)
that's the whole vibe check right there π
β¨ DESCRIPTION β¨
so what it does: it writes the NUL-terminated string text onto the target bitmap at position x, y, using the font you specified. that's it. that's the function. she's iconic, she's simple π¦
the flags parameter can be 0 or one of these flags:
ALLEGRO_ALIGN_LEFTβ draws the text left-aligned (same as0).ALLEGRO_ALIGN_CENTREβ draws the text centered around the position you gave it.ALLEGRO_ALIGN_RIGHTβ draws the text right-aligned to the position you gave it.
and bestie, it can also be combined with this flag:
ALLEGRO_ALIGN_INTEGERβ always draws text aligned to an integer pixel position. and like, fun fact: this was formerly the default behaviour π Since: 5.0.8, 5.1.4
π¨ important heads up bestie π¨ this function does not support newline characters (\n). so if you're out here trying to be all multi-line and fancy, you can't β but you can useal_draw_multiline_text(3)for multi line text output, and she ate π
π«Ά SEE ALSO π«Ά
al_draw_ustr(3), al_draw_textf(3), al_draw_justified_text(3), al_draw_multiline_text(3).
and that's the page fr fr π β straight out of the Allegro reference manual, for al_draw_text(3). go forth and draw, queen πβ¨
π¦ where this page comes from
- arch rolling: allegro 5.2.11.3-2 Β· Zlib AND BSD-3-Clause AND OFL-1.1 AND LicenseRef-Custom
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms