textout_centre_ex(3)
β¨ textout_centre_ex β¨
okay bestie so this one lives in the Allegro manual and it's literally called textout_centre_ex β she's the one who writes a string centered on a bitmap π part of the Allegro game programming library, no big deal π
πΈ SYNOPSIS πΈ
#include <allegro.h>
void textout_centre_ex(BITMAP *bmp, const FONT *f, const char *s, int x,
y, int color, int bg);
π DESCRIPTION π
So likeβ¦ she's exactly like textout_ex(), bestie, no cap β same energy β except the x coordinate is interpreted as the centre instead of the left edge of the string. The way that changes EVERYTHING for you when you want your text actually centered ππ
Example time, look at her:
/* Important texts go in the middle. */
width = text_length("GAME OVER");
textout_centre_ex(screen, font, "GAME OVER",
SCREEN_W / 2, SCREEN_H / 2,
makecol(255, 0, 0), makecol(0, 0, 0));
not thewidth = text_length("GAME OVER");line doing its little thing and thenwidthnot even getting used in the call π iconic behavior fr fr, we don't question it, we just vibe π¦
π SEE ALSO π
Allegro, version 4.4.3, and this whole page is textout_centre_ex(3) β mwah, love u, go center something pretty πβ¨π«Ά
π¦ 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