How to display text on video?

I’ve been trying various things to get this to work but nothing so far works
well. I’m playing video with a SDL_Overlay and have a SDL_Surface. Ideally I’d
like to just use SDL_ttf to put transparent text on the video. What is the best
way to do this?

thanks,
Bob

Is it even possible?On Tue, Jul 17, 2007 at 05:35:42AM -0400, Bob Self wrote:

I’ve been trying various things to get this to work but nothing so far works
well. I’m playing video with a SDL_Overlay and have a SDL_Surface. Ideally I’d
like to just use SDL_ttf to put transparent text on the video. What is the best
way to do this?

thanks,
Bob

Bob Self <bobself charter.net> writes:

Ideally I’d like to just use SDL_ttf to put transparent text on the video.
What is the best way to do this?

Hi Bob,

I’ve just been playing around with SDL_TTf myself recently… It seems to me
that you basically want the background of the text to be transparent, right? If
you know the background colour of the text (you could force it with an
SDL_FillRect or something if desperate!), you might be able to use
SDL_SetColorKey - with a bonus that since you have large-ish gaps between and
around text lettering you might also be able to take advantage of RLE
acceleration to make blitting your text even quicker.

I’ve not tried this, so it is a theoretical answer… I’d be curious to know if
it worked, though, since I might have to do the same thing with my game.

HTH,
-J> On Tue, Jul 17, 2007 at 05:35:42AM -0400, Bob Self wrote: