Hello everyone!
I was wondering how to create a transparent surface (alpha 0).
SDL_CreateRGBSurface fills it black, but I’m blitting tiles to this
surface, and whenever I blit that to the screen the black background
shows up…
Anyonw know how to do this? Thanks!
(Can’t use color keys because my tiles have black in them… maybe I can
fill it with, say, magenta?)
This should fill the surface with transparent pixels:
SDL_FillRect(surface, NULL, SDL_MapRGBA(surface->format, 0, 0, 0, 0));
http://www.libsdl.org/cgi/docwiki.cgi/SDL_5fFillRect says: “If the
color value contains an alpha value then the destination is simply
"filled” with that alpha information, no blending takes place."On 6/7/07, L-28C wrote:
Hello everyone!
I was wondering how to create a transparent surface (alpha 0).
SDL_CreateRGBSurface fills it black, but I’m blitting tiles to this
surface, and whenever I blit that to the screen the black background
shows up…
Anyonw know how to do this? Thanks!
(Can’t use color keys because my tiles have black in them… maybe I can
fill it with, say, magenta?)
–
Markus Laire