textout_ex(3)

πŸ“¦ version 4.4.3.1, in fedora 43, fedora 44

✨ textout_ex ✨

okay bestie, welcome to the Allegro manual πŸ’– this one's called textout_ex(3) and it's genuinely one of the cutest little functions in the whole Allegro game programming library. she writes a string on a bitmap. that's it. that's the whole job. and she EATS. πŸ’…


🌸 NAME 🌸

textout_ex β€” writes a string on a bitmap. Allegro game programming library. πŸ¦‹


✨ SYNOPSIS ✨

#include <allegro.h>

void textout_ex(BITMAP *bmp, const FONT *f, const char *s, int x, int y,
int color, int bg);

πŸ’– DESCRIPTION πŸ’–

so basically, she writes the string s onto the bitmap at position x, y, using the font you picked, the foreground color you picked, and the background color you picked. no cap. that's the whole vibe. πŸŽ€

  • if the background color is -1, the text gets written transparently β€” like, no box behind it, just the letters floating there being main character energy ✨
  • if the foreground color is -1 and you're using a color font, she draws it using the colors from the original font bitmap (the one you imported into the grabber program) β€” which is how you get multicolored text output. iconic behavior honestly 🌈
  • for high and true color fonts, the foreground color is ignored and always treated as -1. so don't even bother, she's not listening πŸ™ˆ

πŸ“ Example πŸ“

/* Show the program's version in blue letters. */
textout_ex(screen, font, "v4.2.0-beta2", 10, 10,
           makecol(0, 0, 255), -1);
not me showing the program version in blue letters with a transparent background… the serve is real πŸ˜­πŸ’™

πŸ‘‘ SEE ALSO πŸ‘‘


and that's the whole page bestie 🫢 this was Allegro version 4.4.3, manual page textout_ex(3), and yes she's been that girl since forever. πŸ’œβ­πŸ§š

πŸ“¦ where this page comes from