al_draw_tinte..._bitmap_region(3alleg5)

πŸ“¦
version 5.2.11.3 Β· 4 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

al_draw_tinted_scaled_rotated_bitmap_region β€” Allegro 5 API, bestie. The name is a whole mouthful fr fr, so we're calling it "the region one" from here on, iykyk.


✨ SYNOPSIS ✨

#include <allegro5/allegro.h>

void al_draw_tinted_scaled_rotated_bitmap_region(ALLEGRO_BITMAP *bitmap,
   float sx, float sy, float sw, float sh,
   ALLEGRO_COLOR tint,
   float cx, float cy, float dx, float dy, float xscale, float yscale,
   float angle, int flags)

🌸 DESCRIPTION 🌸

Okay so it's literally al_draw_tinted_scaled_rotated_bitmap(3alleg5) β€” same energy, same slay β€” except you get to pick a specific little area inside the bitmap to actually draw. Crop moment. πŸ’…

And if you're sitting there like "can't I just do this another way", yes babes, you can β€” you can get the exact same effect with a sub bitmap:

al_draw_tinted_scaled_rotated_bitmap(bitmap, sx, sy, sw, sh, tint,
    cx, cy, dx, dy, xscale, yscale, angle, flags);

/* This draws the same: */
sub_bitmap = al_create_sub_bitmap(bitmap, sx, sy, sw, sh);
al_draw_tinted_scaled_rotated_bitmap(sub_bitmap, tint, cx, cy,
    dx, dy, xscale, yscale, angle, flags);

Same result, two roads, both iconic. 🌈

Heads up though β€” go read al_draw_bitmap(3alleg5) for the note about restrictions on which bitmaps can be drawn where. Not every bitmap gets to show up everywhere, and that's just the rules, no cap. 🫢

πŸ¦‹ SINCE πŸ¦‹

5.0.6, 5.1.0 β€” so she's been around a minute. Vintage, honestly. πŸ‘‘


πŸŽ€ SEE ALSO πŸŽ€


And that's the whole page, bestie!! This was the Allegro reference manual talking about al_draw_tinte..._bitmap_region(3alleg5), and honestly? She ate. Go draw something cute with a sub-region of a bitmap and think of me. Byeee πŸ’œπŸ§šπŸ“

πŸ“¦ where this page comes from