1draw_lit_sprite(3) Allegro manual draw_lit_sprite(3)
2
3
4
6 draw_lit_sprite - Draws a sprite tinted with a specific color. Allegro
7 game programming library.
8
10 #include <allegro.h>
11
12
13 void draw_lit_sprite(BITMAP *bmp, BITMAP *sprite, int x, int y, int
14 color);
15
17 In 256-color modes, uses the global color_map table to tint the sprite
18 image to the specified color or to light it to the level specified by
19 (create_trans_table or create_light_table), and draws the resulting
20 image to the destination bitmap. In truecolor modes, uses the blender
21 functions to light the sprite image using the alpha level specified by
22 'color' (the alpha level which was passed to the blender functions is
23 ignored) and draws the resulting image to the destination bitmap. The
24 'color' parameter must be in the range [0-255] whatever its actual
25 meaning is. This must only be used after you have set up the color map‐
26 ping table (for 256-color modes) or blender functions (for truecolor
27 modes). Example:
28
29 /* Some one time initialisation code. */
30 COLOR_MAP global_light_table;
31 create_light_table(&global_trans_table, my_palette,
32 10, 10, 60, NULL);
33 ...
34 if (get_color_depth() == 8)
35 color_map = &global_light_table;
36 else
37 set_trans_blender(40, 40, 255, 255);
38
39 /* Lit the cape with a blueish light. */
40 draw_lit_sprite(buffer, colored_cape, x, y, 64);
41
42
44 draw_sprite(3), draw_trans_sprite(3), draw_gouraud_sprite(3),
45 draw_lit_rle_sprite(3), color_map(3), set_trans_blender(3), bit‐
46 map_mask_color(3), exblend(3)
47
48
49
50Allegro version 4.4.2 draw_lit_sprite(3)