draw_sprite_ex(3)
β¨ draw_sprite_ex(3) β¨
okay bestie, welcome to the Allegro manual π this one lives in section 3, and it's about drawing a sprite that can be flipped, blended or tinted β all in one gloriously extra little function. no cap.
πΈ NAME πΈ
draw_sprite_ex β draws an optionally flipped / blended / tinted sprite onto the bitmap. it's part of the Allegro game programming library, and yes it ate. π
π SYNOPSIS π
#include <allegro.h>
void draw_sprite_ex(BITMAP *bmp, BITMAP *sprite, int x, int y, int mode,
int flip);
look at her. five arguments. bmp is where it lands, sprite is what lands, x and y are where, and then mode and flip decide how β which is the whole point of this function existing, fr fr. π
π¦ DESCRIPTION π¦
so the way this works is: she draws the sprite image onto the destination bitmap using whatever you put in the mode argument, and she optionally flips the sprite in the orientation you specify with the flip argument. two little dials, infinite vibes. β¨
first dial, the mode argument β this is the one that says how the sprite is gonna get drawn onto the destination bitmap:
DRAW_SPRITE_NORMALβ draws a masked sprite, exactly likedraw_sprite()does πDRAW_SPRITE_LITβ draws a tinted sprite, likedraw_lit_sprite()πDRAW_SPRITE_TRANSβ draws a blended sprite, likedraw_trans_sprite()π«§
second dial, the flip argument β this one sets the flipping orientation:
DRAW_SPRITE_NO_FLIP = 0β do not perform flipping. she stays exactly as she is, no notes π€DRAW_SPRITE_H_FLIPβ flip horizontally. mirror mode, main character energy πͺDRAW_SPRITE_V_FLIPβ flip vertically. upside-down era, lowkey unhinged πDRAW_SPRITE_VH_FLIPβ flip both vertically and horizontally. chaos. iconic. both at once π₯
ngl the note thatDRAW_SPRITE_NO_FLIPequals0is doing a lot of work here β that's your "default" vibe, so if you just pass0you get a regular un-flipped sprite. π
π SEE ALSO π
go read these next, bestie, they're the whole friend group:
draw_sprite(3)draw_sprite_v_flip(3)draw_sprite_h_flip(3)draw_trans_sprite(3)draw_lit_sprite(3)extrans2(3)
and that's the page, babes π this was Allegro version 4.4.3, draw_sprite_ex(3), signing off β go draw something gorgeous, you've got this π«Άπ
π¦ 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