[SDL] Border around text with TTF_RenderText

James Buchwald jamestheprogrammer at gmail.com
Fri Jun 8 10:08:24 PDT 2007


There's three render modes for SDL_ttf... solid, shaded, and blended. If you
want smooth text with a transparent background, just go with blended. It
comes out with a transparent background, and it's still pretty fast.

As for the borders, I don't know. I don't think that functionality is built
in - you might have to write your own routines for that, if you really need
that.

On 6/8/07, voidstar <voidstar at tin.it> wrote:
>
> In my program I'm using this to write text:
>
> SDL_Color clrWhite = { 255,255,255, 0 };
> SDL_Color clrBlack = { 0, 0, 0, 0 };
> ...
> TTF_RenderText_Shaded(font, "Hello", clrWhite, clrBlack);
>
> Is it possible to have a black (for example) border around each letter?
> Also, is it possible to set "transparent" as background color for the
> text?
>
> To have transparent color as background I could simply use
> TTF_RenderText_Solid,
> but using this function the text is not smooth.
>
>
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>



-- 
"If you see somebody who you don't know getting into a crop duster that
doesn't belong to you, report them." -- President George W. Bush
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20070608/cd77a210/attachment.htm 


More information about the SDL mailing list