1create_trans_table(3)           Allegro manual           create_trans_table(3)
2
3
4

NAME

6       create_trans_table  -  Fills  a  color  mapping  table for translucency
7       effects. Allegro game programming library.
8

SYNOPSIS

10       #include <allegro.h>
11
12
13       void create_trans_table(COLOR_MAP *table, const PALETTE pal, int r,  g,
14       b, void (*callback)(int pos));
15

DESCRIPTION

17       Fills  the  specified  color  mapping  table with lookup data for doing
18       translucency effects with the specified  palette.  When  combining  the
19       colors  c1 and c2 with this table, the result will be a color somewhere
20       between the two. The r, g, and b parameters  specify  the  solidity  of
21       each  color  component,  ranging  from  0  (totally transparent) to 255
22       (totally solid). For 50% solidity, pass 128.
23
24       This function treats source color #0 as a  special  case,  leaving  the
25       destination  unchanged  whenever a zero source pixel is encountered, so
26       that masked sprites will draw correctly. This function will take advan‐
27       tage  of  the global rgb_map variable to speed up color conversions. If
28       the callback function is not NULL, it will be called 256  times  during
29       the calculation, allowing you to display a progress indicator. Example:
30
31          COLOR_MAP trans_table;
32          ...
33          /* Build a color lookup table for translucent drawing. */
34          create_trans_table(&trans_table, pal, 128, 128, 128, NULL);
35
36

SEE ALSO

38       color_map(3),    create_light_table(3),   create_color_table(3),   cre‐
39       ate_blender_table(3),     draw_trans_sprite(3),     draw_lit_sprite(3),
40       draw_gouraud_sprite(3), rgb_map(3), ex3d(3), extrans(3)
41
42
43
44Allegro                          version 4.4.2           create_trans_table(3)
Impressum