[SDL] Transparent Font Rendering
skinncode at centras.lt
Thu Mar 22 19:59:00 PST 2001
> Uhm, that's exactly why you'd use colorkeying. If it doesn't work that may,
> you're probably doing something wrong somewhere. :-)
> > And i have one more question I don't know if it's a right place to ask,
> > but does SDL_image support transparent .png? I get a black background
> > instead when i blit it ...
> It works for me... You have to
> SDL_SetAlpha(image, SDL_SRCALPHA|SDL_RLEACCEL, 0);
> or something to get SDL to actually use the alpha channel when blitting.
> The same applies to colorkeying; you have to set the color and activate it
> for the source surface, like this:
> SDL_SetColorKey(image, SDL_SRCCOLORKEY|SDL_RLEACCEL,
> where "255,0,255" is the color to be transparent. (SDL_RLEACCEL is to
> accelerate software blitting.)
Thanls a lot! It worked. Both ttf and png.
More information about the SDL