pivot_sprite(3)

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

πŸ’– NAME πŸ’–

pivot_sprite β€” bestie, it rotates a sprite around a specified point. Like, that's the whole thing. It's from the Allegro game programming library, and it's giving "spin me right round" energy. πŸŒ€βœ¨


🌸 SYNOPSIS 🌸

#include <allegro.h>

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

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so. pivot_sprite() is literally the sibling of rotate_sprite() β€” same rotation vibe β€” but with a lil glow-up. πŸ’…

Here's the tea: it takes the point in the sprite that you gave it with (cx, cy), and it aligns that point to (x, y) in the bitmap. Then it rotates the whole thing around that point. 🎯

So like, instead of the sprite spinning around its own boring little default spot, it spins around the exact point you chose. Main character pivot energy, no cap. πŸ‘‘

Bestie heads up: it's like rotate_sprite(), so if you already know that one, you already know this one. Just with the pivot alignment on top. 🫢

🌈 SEE ALSO 🌈


and that's the whole page bestie!! πŸŽ€ tysm for reading, ily, go rotate something iconic. this was pulled straight from the Allegro manual, version 4.4.3 β€” mwah πŸ’‹β­

πŸ“¦ where this page comes from