stretch_sprite(3)
β¨ NAME β¨
stretch_sprite β stretches a sprite to the destination bitmap. It's part of the Allegro game programming library, bestie π
πΈ SYNOPSIS πΈ
#include <allegro.h>
void stretch_sprite(BITMAP *bmp, BITMAP *sprite, int x, int y, int w, int h);
π DESCRIPTION π
Okay so picture draw_sprite() β that's the vibe, that's the blueprint. Now take that and add stretch energy. π
stretch_sprite() does what draw_sprite() does, except it can stretch the sprite image to whatever width and height you ask for. She's flexible like that. π
But β and this is the important part, no cap β there are two conditions:
- The sprite image and the destination bitmap must be of the same color depth. Same depth or it's not happening, fr fr.
- The sprite image must be a memory bitmap. That's a hard requirement, not a suggestion.
Example time, because you know we love an example β¨:
/* Create tunnel like effect. */
for (step = 1; step
int width = SCREEN_W / step;
int height = SCREEN_H / step;
stretch_sprite(screen, image, SCREEN_W / 2 - width / 2,
SCREEN_H / 2 - height / 2, width, height);
}
Okay bestie I'm gonna be so real with you: that's literally where the manpage cuts off. That for line ends mid-thought π. I'm not touching it, I'm not "fixing" it, I'm just delivering it to you exactly as the ancestors wrote it. π«Ά
π¦ SEE ALSO π¦
That's the whole page, gorgeous. Go stretch something. π This was brought to you by Allegro, version 4.4.3 πΈ β stay iconic, and remember: same color depth, memory bitmap, no exceptions. π
π¦ 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