al_draw_text(3)

πŸ“¦
version 5.2.11.3 Β· 3 versions
, in arch rolling

πŸ’… 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 as 0).
  • 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 use al_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