draw_trans_sprite - Online Linux Manual PageSection : 3
Updated : version 4.4.3
Source : Allegro
Note : Allegro manual
NAMEdraw_trans_sprite − Draws a sprite blending it with the destination. Allegro game programming library.
SYNOPSIS#include <allegro.h> void draw_trans_sprite(BITMAP *bmp, BITMAP *sprite, int x, int y);
DESCRIPTIONUses the global color_map table or truecolor blender functions to overlay the sprite on top of the existing image. This must only be used after you have set up the color mapping table (for 256-color modes) or blender functions (for truecolor modes). Because it involves reading as well as writing the bitmap memory, translucent drawing is very slow if you draw directly to video RAM, so wherever possible you should use a memory bitmap instead. Example: /* Some one time initialisation code. */
COLOR_MAP global_trans_table;
create_trans_table(&global_trans_table, my_palette,
128, 128, 128, NULL);
...
if (get_color_depth() == 8)
color_map = &global_trans_table;
else
set_trans_blender(128, 128, 128, 128);
draw_trans_sprite(buffer, ghost_sprite, x, y);The bitmap and sprite must normally be in the same color depth, but as a special case you can draw 32 bit RGBA format sprites onto any hicolor or truecolor bitmap, as long as you call set_alpha_blender() first, and you can draw 8-bit alpha images onto a 32-bit RGBA destination, as long as you call set_write_alpha_blender() first. As draw_sprite() this function skips transparent pixels, except if the source sprite is an 8-bit image; if this is the case, you should pay attention to properly set up your color map table for index 0.
SEE ALSOdraw_sprite(3), draw_lit_sprite(3), draw_trans_rle_sprite(3), color_map(3), set_trans_blender(3), set_alpha_blender(3), set_write_alpha_blender(3), bitmap_mask_color(3), exalpha(3), exblend(3), exlights(3), exrotscl(3), extrans(3), exxfade(3) 0
Johanes Gumabo
Data Size : 5,976 byte
man-draw_trans_sprite.3Build : 2024-12-05, 20:55 :
Visitor Screen : x
Visitor Counter ( page / site ) : 3 / 189,079
Visitor ID : :
Visitor IP : 3.142.42.247 :
Visitor Provider : AMAZON-02 :
Provider Position ( lat x lon ) : 39.962500 x -83.006100 : x
Provider Accuracy Radius ( km ) : 1000 :
Provider City : Columbus :
Provider Province : Ohio , : ,
Provider Country : United States :
Provider Continent : North America :
Visitor Recorder : Version :
Visitor Recorder : Library :
Online Linux Manual Page : Version : Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page : Library : lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page : Library : lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base : Version : Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base : Library : lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36
Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.