Transparencies

OK, blitting something to a surface… how does it handle transparent
sprites? I dont’ see anything in the docs… do I just have to create a
transparent bitmap, or…? Does ImageMagick create transparent .bmp files
when the input is a transparent .xpm?--------------------------------------------------
Scott M. Stone <sstone at pht.com, sstone at pht.co.jp>
Head of TurboLinux Development/Systems Administrator
Pacific HiTech, Inc (USA) / Pacific HiTech, KK (Japan)

Use the SDL_SetColorKey function on the surface that you wish to make
transparent. To make a surface called sprite
transparent with all black pixels you would use something similar to the
following:

SDL_SetColorKey(Sprite, (SDL_SRCCOLORKEY|SDL_RLEACCEL),
SDL_MapRGB(screen->format,0,0,0));

Hope this helps.> OK, blitting something to a surface… how does it handle transparent

sprites? I dont’ see anything in the docs… do I just have to create a
transparent bitmap, or…? Does ImageMagick create transparent .bmp files
when the input is a transparent .xpm?


Scott M. Stone <sstone at pht.com, sstone at pht.co.jp>
Head of TurboLinux Development/Systems Administrator
Pacific HiTech, Inc (USA) / Pacific HiTech, KK (Japan)