textprintf_right_ex(3)

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

Allegro manual β€” textprintf_right_ex(3) πŸ’– bestie we are SO doing right-aligned text today.

✨ NAME ✨

textprintf_right_ex β€” formatted right aligned output of a string. It's part of the Allegro game programming library, periodt. πŸ‘‘

πŸ“œ SYNOPSIS πŸ“œ

       #include <allegro.h>

       void textprintf_right_ex(BITMAP *bmp, const FONT *f, int x, y, color,
       bg, const char *fmt, ...);

πŸ’… DESCRIPTION πŸ’…

Okay so it's like textprintf_ex() but β€” plot twist β€” the x coordinate is interpreted as the right edge of the string, not the left. So your text gets right-aligned, slay. πŸ¦‹

Heads up bestie: this function shares the text length limitation of textprintf_ex(). So don't come for me if your string is too long, it's giving same limits. 😭

Example time, look at this:

          textprintf_right_ex(screen, font, SCREEN_W - 10, 10,
                              makecol(200, 200, 20), -1,
                              "%d bullets left", player_ammo);

That's the whole vibe. The x is SCREEN_W - 10, so the right edge sits 10 pixels from the right. Cute.

πŸ‘€ SEE ALSO πŸ‘€


mwah πŸ’‹ Allegro, version 4.4.3, textprintf_right_ex(3) β€” that's the whole manual page, bestie. 🫢

πŸ“¦ where this page comes from