draw_sprite_ex(3alleg4)

πŸ’– draw_sprite_ex β€” the Allegro manual, but make it cute πŸ’–

okay so bestie, we're in the Allegro manual, section 3alleg4, and today's main character is draw_sprite_ex β€” she draws a sprite onto a bitmap and she can flip it, blend it, or tint it while she's at it. Allegro game programming library, iconic behavior honestly. ✨


🌸 SYNOPSIS 🌸

#include <allegro.h>

void draw_sprite_ex(BITMAP *bmp, BITMAP *sprite, int x, int y, int mode,
int flip);

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the vibe: draw_sprite_ex draws the sprite image onto the destination bitmap bmp, using whatever mode you passed in, and optionally flipping that sprite in the orientation you picked with the flip argument. Two knobs, one function, endless slay. πŸ’…

The mode argument is literally just deciding how the sprite gets drawn onto the destination bitmap:

  • DRAW_SPRITE_NORMAL β€” draws a masked sprite, exactly like draw_sprite() does
  • DRAW_SPRITE_LIT β€” draws a tinted sprite, exactly like draw_lit_sprite() does
  • DRAW_SPRITE_TRANS β€” draws a blended sprite, exactly like draw_trans_sprite() does

And the flip argument is the one holding the mirror, she defines the flipping orientation:

  • DRAW_SPRITE_NO_FLIP = 0 β€” do not perform flipping, she's staying exactly as she is
  • DRAW_SPRITE_H_FLIP β€” flip horizontally
  • DRAW_SPRITE_V_FLIP β€” flip vertically
  • DRAW_SPRITE_VH_FLIP β€” flip both vertically and horizontally, the full 360Β° glow-up

πŸ‘‘ SEE ALSO πŸ‘‘

Go give these queens a read too, they're all in the same friend group:


and that's the whole page, bestie 🫢 no cap, you now know draw_sprite_ex better than most people know themselves.

this was Allegro, version 4.4.3, serving draw_sprite_ex(3alleg4) realness. bye babe, go flip some sprites πŸ’–βœ¨πŸŽ€