draw_character_ex(3alleg)

draw_character_ex3alleg

Draws non transparent pixels of the sprite with a color. allegro game programming library.

Usage

#include <allegro.h>

void draw_character_ex(BITMAP *bmp, BITMAP *sprite, int x, int y, color, bg);

Overview

Draws a copy of the sprite bitmap onto the destination bitmap at the specified position, drawing transparent pixels in the background color (or skipping them if the background color is -1) and setting all other pixels to the specified color. Transparent pixels are marked by a zero in 256-color modes or bright pink for truecolor data (maximum red and blue, zero green). The sprite must be an 8-bit image, even if the destination is a truecolor bitmap. Example:

   BITMAP *logo;
   ...
   /* Draw the logo silhouette in red. */
   draw_character_ex(screen, logo, SCREEN_W / 2, SCREEN_H / 2,
                     makecol(255, 0, 0), -1);

Releases

4 releases since Debian 3.1 (Sarge); the text changed 2 times.

  1. 3.1
  2. 4.0
  3. 5.0–6.0

From liballegro-doc 2:4.2.2-2.2 in Debian 6.0 (Squeeze). Parsed by carta from the page's man source.