ROTATE_SPRITE_V_FLIP_TRANS(3alleg4)

✨ NAME ✨

okay bestie, so rotate_sprite_v_flip_trans β€” it rotates AND flips a sprite, and it's part of the Allegro game programming library πŸ’– (this is the 3alleg4 page, in case the manual name wasn't obvious, which, slay, now it is).


πŸŽ€ SYNOPSIS πŸŽ€

#include <allegro.h>

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

like, that's the whole vibe. five args, one destiny πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

So you already know rotate_sprite_trans, right? This is literally that, except it flips the image vertically first, and then rotates it. Flip then rotate. Order matters, bestie, don't come for me 🌸

Want to flip horizontally instead? Cute. Use this exact routine, but add itofix(128) to the angle. That's it. That's the trick. The way that one little addition does all of that… iconic, honestly 😭

Want to flip in both directions? Then you reach for rotate_sprite() instead, and you add itofix(128) to its angle. Two flips, one function call, main character energy fr fr πŸ‘‘

ngl the itofix(128) thing is the entire secret sauce here β€” half a full turn in fixed point. just remember it and you're set 🫢

🌈 SEE ALSO 🌈


okay that's the whole page!! this was Allegro, version 4.4.3, and yes the header up top was doing the little rotate_spr...flip_trans(3alleg4) abbreviation thing because manpage titles are dramatic like that. bye bestie, go flip something vertically πŸ¦‹πŸ’–βœ¨