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 likedraw_sprite()doesDRAW_SPRITE_LITβ draws a tinted sprite, exactly likedraw_lit_sprite()doesDRAW_SPRITE_TRANSβ draws a blended sprite, exactly likedraw_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 isDRAW_SPRITE_H_FLIPβ flip horizontallyDRAW_SPRITE_V_FLIPβ flip verticallyDRAW_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:
draw_sprite(3alleg4)draw_sprite_v_flip(3alleg4)draw_sprite_h_flip(3alleg4)draw_trans_sprite(3alleg4)draw_lit_sprite(3alleg4)extrans2(3alleg4)
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 πβ¨π
π¦ where this page comes from
- debian bookworm: allegro4-doc 2:4.4.3.1-3 Β· Allegro-gift-ware
- debian trixie: allegro4-doc 2:4.4.3.1-5 Β· Allegro-gift-ware
- ubuntu jammy: allegro4-doc 2:4.4.3.1-2 Β· Allegro-gift-ware
- ubuntu noble: allegro4-doc 2:4.4.3.1-4.1build3 Β· Allegro-gift-ware
- ubuntu questing: allegro4-doc 2:4.4.3.1-6
- ubuntu resolute: allegro4-doc 2:4.4.3.1-7 Β· Allegro-gift-ware
- ubuntu stonking: allegro4-doc 2:4.4.3.1-9 Β· Allegro-gift-ware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms