- Online Community Forums » Programming Questions » Printing tex on top of a bitmap image??

Credits go to moon_rabbits for helping out!
This thread is locked; no one can reply to it. rss feed Print
Printing tex on top of a bitmap image??
Member #8,681
May 2007

Howdy everyone.

I have been looking and searching the forums here for an answer and I am either missing it, or I am to dense to recognize it when I see it. :)

I am working on learning C and Allegro.

I have a small program right now that loads a bitmap image and displays it.
That part is working fine.

Also have it loading a wav file and play that...That i working fine too.

What is giving me trouble right now is printing something on the screen with the bitmap.

I have tried using several methods. What I get s the text on the bitmap in a black box.

I assume I am erasing the bitmap in that spot and writing the text.

I have tried bliting to the screen, a double buffer, etc.
Always the same result.

Anyone who can point me in the right direction here? I don't necessarily want you to write the code...Just point me to the info would be fine.



Member #8,469
March 2007

You draw the bitmap first, right? If you do, the text is being written over top and the black background behind it is blocking out some of the bitmap.

Use this:

textout_ex(BITMAP *bmp, const FONT *f, const char *s, int x, y, color, bg);  

/*This will draw the string "This is the text" in white, at (x, y) on the screen. The  (-1) passed to bg will cause the background of the text to be transparent, not black */
textout_ex(screen, font, "This is the text", x, y, makecol(255,255,255), (-1));

Member #8,681
May 2007

Thanks.. I will give that a whirl and see what happens.

I just figured out how to customize a mouse pointer :P so I gotta finish
playing with that first.



That fixed the issue. Thanks a bunch!!!!


Go to: