pivot_sprite_trans(3alleg4)

✨ NAME ✨

pivot_sprite_trans β€” rotates a sprite around a specified point, bestie πŸ’« (this is the Allegro game programming library, in case you were wondering, and it's section 3alleg4 of the manual πŸŽ€)


🌸 SYNOPSIS 🌸

#include <allegro.h>

void pivot_sprite_trans(BITMAP *bmp, BITMAP *sprite, int x, int y, int cx, int cy, fixed angle);

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so picture this: it's giving rotate_sprite_trans() energy, right? Same vibe, same family πŸ’– β€” but with a lil twist.

Here's the tea β˜•: it takes the point in the sprite that you hand it as (cx, cy) and aligns that exact point onto (x, y) in the bitmap. Then β€” and this is the main character moment πŸ‘‘ β€” it rotates the whole thing around that very point. Like the pivot IS the point, no cap.

So (cx, cy) is your ✨anchor✨ and (x, y) is where that anchor lands, and then the sprite just spins around it. Obsessed, honestly. πŸŒ€πŸ’…


πŸ’œ SEE ALSO πŸ’œ


That's the whole page, babes πŸŽ€ β€” this was Allegro, version 4.4.3, and yeah that's it, that's the manual. Go rotate something cute. Byeeeee πŸ’–βœ¨πŸŒΈ