pivot_sprite(3)
π 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 π
rotate_sprite(3)β the OG rotation, no pivot π«pivot_scaled_sprite(3)β pivot + scale, the deluxe edition β¨pivot_sprite_v_flip(3)β pivot but vertically flipped π¦exsprite(3)β the example, go peek at it π
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
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms