How do I make a bitmap font system with an image background?

Hi, actually I’ve written this question before along with my reply. But
since nobody answered it, I decided to send it in a separate mail.

I’ve looked at Marius Andra and Lazy Foo’s tutorial on a bitmap font
system. The tutorials only explained about fonts without any background
behind the string (or simply a background with one color as in Lazy Foo’s
tutorial). When I implemented the system in my application, it didn’t work
as I planed because behind it there’s a huge background image. Should I
treat the string as a sprite (like saving and updating the background
behind it like the sprite did in Marius Andra’s tutorial)? What about an
everchanging string that can be lengthened or shortened upon an event (eg.
a graphical typewriter game?)?

Thanks in advance,
Bawenang R. P. P.

I can suggest to you to use a transparent surface for the font or and
for the surface where you will put the character.

2006/7/17, benang at cs.its.ac.id :> Hi, actually I’ve written this question before along with my reply. But

since nobody answered it, I decided to send it in a separate mail.

I’ve looked at Marius Andra and Lazy Foo’s tutorial on a bitmap font
system. The tutorials only explained about fonts without any background
behind the string (or simply a background with one color as in Lazy Foo’s
tutorial). When I implemented the system in my application, it didn’t work
as I planed because behind it there’s a huge background image. Should I
treat the string as a sprite (like saving and updating the background
behind it like the sprite did in Marius Andra’s tutorial)? What about an
everchanging string that can be lengthened or shortened upon an event (eg.
a graphical typewriter game?)?

Thanks in advance,
Bawenang R. P. P.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

take a look at crazeeman code, i think there is a half assed font non ttf
system you might find usefull in there, http://www.cloudsprinter.com/crazeeman/----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

Here http://sol.gfxile.net/gp/
you can find an easy way.

In that example you will use a bmp with a black background.

The example is very simple.
You need an image with all the characters you want to use.
All the characters are equal to a number (you can find this number just
looking for a ascii table by google) so you can get the correct char
from the image.

If you want to keep the same background, you need to make a transparent
sdl_surface and blit the rect that contains the character.

benang at cs.its.ac.id ha scritto:> Hi, actually I’ve written this question before along with my reply. But

since nobody answered it, I decided to send it in a separate mail.

I’ve looked at Marius Andra and Lazy Foo’s tutorial on a bitmap font
system. The tutorials only explained about fonts without any background
behind the string (or simply a background with one color as in Lazy Foo’s
tutorial). When I implemented the system in my application, it didn’t work
as I planed because behind it there’s a huge background image. Should I
treat the string as a sprite (like saving and updating the background
behind it like the sprite did in Marius Andra’s tutorial)? What about an
everchanging string that can be lengthened or shortened upon an event (eg.
a graphical typewriter game?)?

Thanks in advance,
Bawenang R. P. P.