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

NAME

6       draw_sprite  -  Draws a copy of the sprite onto the destination bitmap.
7       Allegro game programming library.
8

SYNOPSIS

10       #include <allegro.h>
11
12
13       void draw_sprite(BITMAP *bmp, BITMAP *sprite, int x, int y);
14

DESCRIPTION

16       Draws a copy of the sprite bitmap onto the destination  bitmap  at  the
17       specified  position. This is almost the same as blit(sprite, bmp, 0, 0,
18       x, y, sprite->w, sprite->h), but it uses a masked  drawing  mode  where
19       transparent  pixels  are  skipped,  so  the  background image will show
20       through the masked parts of the sprite. Transparent pixels  are  marked
21       by a zero in 256-color modes or bright pink for truecolor data (maximum
22       red and blue, zero green). Example:
23
24          BITMAP *spaceship;
25          ...
26          draw_sprite(screen, spaceship, x, y);
27
28       If the GFX_HW_VRAM_BLIT_MASKED bit in the gfx_capabilities flag is set,
29       the  current  driver  supports hardware accelerated sprite drawing when
30       the source image is a video  memory  bitmap  or  a  sub-bitmap  of  the
31       screen.  This  is  extremely  fast,  so when this flag is set it may be
32       worth storing some of your more frequently used sprites in an offscreen
33       portion of the video memory.
34
35       Warning:  if  the  hardware acceleration flag is not set, draw_sprite()
36       will not work correctly when used with a  sprite  image  in  system  or
37       video memory so the latter must be a memory bitmap.
38
39       Although  generally not supporting graphics of mixed color depths, as a
40       special case this function can be used to draw 256-color source  images
41       onto  truecolor  destination bitmaps, so you can use palette effects on
42       specific sprites within a truecolor program.
43
44

SEE ALSO

46       draw_sprite_v_flip(3),    draw_trans_sprite(3),     draw_lit_sprite(3),
47       draw_gouraud_sprite(3), stretch_sprite(3), rotate_sprite(3), draw_char‐
48       acter_ex(3),        draw_rle_sprite(3),        draw_compiled_sprite(3),
49       masked_blit(3), blit(3), bitmap_mask_color(3), exsprite(3)
50
51
52
53Allegro                          version 4.4.3                  draw_sprite(3)
Impressum