draw_compiled_sprite(3alleg4)

✨ NAME ✨

draw_compiled_sprite β€” bestie, this one draws a compiled sprite πŸ’… and it lives in the Allegro game programming library πŸŽ€


🌸 SYNOPSIS 🌸

#include <allegro.h>

void draw_compiled_sprite(BITMAP *bmp, const COMPILED_SPRITE *sprite,
int x, int y);

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so draw_compiled_sprite takes your compiled sprite and plops it down onto a bitmap at the exact position you tell it. Slay. ✨

But listen β€” there's a catch, and it's a real one, not a fake one. The sprite must have been compiled for the correct type of bitmap (linear or planar). Get that mismatch wrong and it's giving πŸ’€. Also, big disclaimer: this function does not support clipping. Not even a little. Periodt.

Hint: if not being able to clip compiled sprites is a problem for you, a neat trick is to set up a work surface (memory bitmap, mode-X virtual screen, or whatever) a bit bigger than you really need, and use the middle of it as your screen. That way you can draw slightly off the edge without any trouble... 🫢 iconic behaviour honestly


🌈 SEE ALSO 🌈

  • get_compiled_sprite(3alleg4)
  • draw_sprite(3alleg4)
  • draw_rle_sprite(3alleg4)
  • bitmap_mask_color(3alleg4)

and that's the whole page, bestie!! this one came straight out of the Allegro manual, version 4.4.3 β€” no cap, go read it, it ate πŸ’–βœ¨πŸŽ€