PIVOT_SCALED_SPRITE_V_FLIP_LIT(3alleg4)

πŸ’– pivot_scaled_sprite_v_flip_lit πŸ’–

okay so bestie, we're in the Allegro manual, specifically the pivot_scal...v_flip_lit(3alleg4) page, and this one is chef's kiss for anyone doing sprite gymnastics in the Allegro game programming library. pull up a chair, we're rotating, stretching AND flipping. yes, all three. at once. main character energy fr fr. ✨


πŸŽ€ NAME πŸŽ€

pivot_scaled_sprite_v_flip_lit β€” rotates, stretches and flips a sprite around a specified point. Allegro game programming library. πŸ’…


🌸 SYNOPSIS 🌸

#include <allegro.h>

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

πŸ¦‹ DESCRIPTION πŸ¦‹

so like, this is rotate_scaled_sprite_v_flip_lit()'s cousin, except it's giving pivot. 🫢

it takes the point in the sprite that you tell it about β€” that's the (cx, cy) bestie β€” and lines it up exactly onto (x, y) in the bitmap. then, and only then, does it rotate and scale everything around that point. so the sprite spins and stretches around your chosen anchor instead of around some random default spot. iconic behaviour honestly. πŸ‘‘


πŸ’œ SEE ALSO πŸ’œ


and that's the whole page bestie, no cap. πŸ’– this was pivot_scal...v_flip_lit(3alleg4) from the Allegro manual, version 4.4.3. go forth and pivot ur little heart out. πŸŒˆβ­πŸŽ€