stretch_sprite(3)

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

✨ 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