rotate_sprite_v_flip_trans(3)

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

πŸ’– rotate_sprite_v_flip_trans πŸ’–

ok so bestie, this one lives in the Allegro manual β€” yes, that Allegro, the game programming library, version 4.4.3, we're in our retro era and it's iconic. Let's get into it πŸŽ€


✨ NAME ✨

rotate_sprite_v_flip_trans β€” it rotates a sprite and flips it. Vertically. While being transparent. A whole triple threat, honestly. πŸ‘‘


🌸 SYNOPSIS 🌸

#include <allegro.h>

void rotate_sprite_v_flip_trans(BITMAP *bmp, BITMAP *sprite, int x, int
y, fixed angle);

like, it's just a function, no cap. takes a BITMAP *bmp, a BITMAP *sprite, an int x, an int y, and a fixed angle. slay. ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so picture rotate_sprite_trans, right? literally the same energy β€” but it flips the image vertically before rotating it. flip first, spin second, that's the order, periodt. πŸ™ˆ

now, the way that you'd flip it horizontally instead? use this same routine but add itofix(128) to the angle. yes really, that's the move, iykyk. πŸ’…

and if you want it flipped in both directions? then use rotate_sprite() and add itofix(128) to its angle. that's it. that's the whole trick. 🧚

bestie if you're out here doing horizontal flips and wondering why it looks weird β€” no you're not, you just forgot the itofix(128). we've all been there. 🫢

πŸ”₯ SEE ALSO πŸ”₯


and that's the tea, bestie πŸ’œ this was the Allegro manual, version 4.4.3 β€” go flip something vertically and make it everyone's problem. mwah. πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from