pivot_sprite_trans(3)

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

✨ pivot_sprite_trans(3) ✨

okay so bestie, this is straight from the Allegro manual and it's giving "rotate a sprite but make it pivot" energy. let's get into it πŸ’…


πŸŽ€ NAME πŸŽ€

pivot_sprite_trans β€” Rotates a sprite around a specified point. Allegro game programming library.

fr fr that's the whole vibe. it spins your sprite around a point you pick. iconic.


🌸 SYNOPSIS 🌸

#include <allegro.h>

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

no cap, that's the exact signature. don't @ me.


πŸ¦‹ DESCRIPTION πŸ¦‹

Like rotate_sprite_trans(), but aligns the point in the sprite given by (cx, cy) to (x, y) in the bitmap, then rotates around this point.

so basically: you tell it which point of the sprite is the main character (cx, cy), you tell it where that point should land in the destination bitmap (x, y), and then it rotates around that point. it's giving "put your fave pixel exactly here and spin around it" πŸ’–


πŸ’œ SEE ALSO πŸ’œ

go read those too, bestie, they're all in the same friend group 🫢


Allegro version 4.4.3 β€” that's the source and version, and this page is pivot_sprite_trans(3). mwah, periodt. πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from