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 π
rotate_sprite_trans(3alleg4)β the sibling, the blueprint π«Άpivot_scaled_sprite_trans(3alleg4)β same energy but it also scales, slaypivot_sprite_v_flip_trans(3alleg4)β for when you wanna flip it vertically too π¦exsprite(3alleg4)β go look at the example, it's iconic β
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 πβ¨πΈ
π¦ where this page comes from
- debian bookworm: allegro4-doc 2:4.4.3.1-3 Β· Allegro-gift-ware
- debian trixie: allegro4-doc 2:4.4.3.1-5 Β· Allegro-gift-ware
- ubuntu jammy: allegro4-doc 2:4.4.3.1-2 Β· Allegro-gift-ware
- ubuntu noble: allegro4-doc 2:4.4.3.1-4.1build3 Β· Allegro-gift-ware
- ubuntu questing: allegro4-doc 2:4.4.3.1-6
- ubuntu resolute: allegro4-doc 2:4.4.3.1-7 Β· Allegro-gift-ware
- ubuntu stonking: allegro4-doc 2:4.4.3.1-9 Β· Allegro-gift-ware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms