textout_ex(3alleg4)

✨ textout_ex ✨

okay so bestie, this one lives in the Allegro manual and it's literally called textout_ex β€” she writes a string on a bitmap πŸ’– Allegro game programming library, you know the vibe.


🌸 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 the whole point: she writes the string s onto the bitmap at position x, y, using the font you picked, plus a foreground color and a background color. That's it, that's the job πŸ’…

now the iconic part, the little details that actually matter:

  • if the background color is -1, then the text gets written transparently β€” no box behind it, just vibes ✨
  • if the foreground color is -1 and a color font is in use, it gets drawn using the colors from the original font bitmap (the one you imported into the grabber program, yes that one πŸŽ€) which is what lets you do multicolored text output. so pretty.
  • for high and true color fonts, the foreground color is ignored and always treated as -1. no cap, she just does that. πŸ‘‘

example time, here's the actual one:

/* Show the program's version in blue letters. */
textout_ex(screen, font, "v4.2.0-beta2", 10, 10,
           makecol(0, 0, 255), -1);

πŸ’œ SEE ALSO πŸ’œ


go read those too bestie, iykyk 🫢

and that's the page!! brought to you by Allegro, version 4.4.3 β€” mwah, ily, go draw some text πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈ