textprintf_centre_ex(3)
π textprintf_centre_ex β the Allegro manual, but make it cute β¨
okay bestie, we're in the Allegro game programming library manual, and today's main character is textprintf_centre_ex. she prints formatted text. she centres it. she slays. let's get into it π
β¨ NAME β¨
textprintf_centre_ex β formatted centered output of a string, from the Allegro game programming library π¦
πΈ SYNOPSIS πΈ
#include <allegro.h>
void textprintf_centre_ex(BITMAP *bmp, const FONT *f, int x, int y, int
color, int bg, const char *fmt, ...);
π DESCRIPTION π
okay so. this one is literally textprintf_ex()'s cooler twin β same energy, but she treats the x coordinate as the centre of the string instead of the left edge. main character positioning only, no cap π
lowkey important though: this function shares the text length limitation of textprintf_ex(). so like, know that going in, bestie. don't say I didn't warn you π
here's the vibe in action:
textprintf_centre_ex(screen, font, SCREEN_W / 2, 120,
makecol(0, 100, 243), -1,
"Your best score so far was %d!",
total_max_points);
the way that SCREEN_W / 2 just drops your text dead centre... obsessed. genuinely. π₯
π SEE ALSO π
iykyk, go read those next π«Ά
Allegro, version 4.4.3 β mwah, that's the whole page babes, textprintf_centre_ex(3) out πβ¨π
π¦ where this page comes from
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms