Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Color Fonts in allegro...

This thread is locked; no one can reply to it. rss feed Print
Color Fonts in allegro...
Don Freeman
Member #5,110
October 2004
avatar

Ok,

I am trying to load a color font (attached) using Allegro's load_font() function. It loads correctly, but I can't change the colors of the text. Is there a way to do this using 32-bit colored fonts? I am asking, because I want to have a colored outline on the font, but be able to change the inside color of the font.

Thanks everyone,
Donald

--
"Everyone tells me I should forget about you, you don’t deserve me. They’re right, you don’t deserve me, but I deserve you."
"It’s so simple to be wise. Just think of something stupid to say and then don’t say it."

gnolam
Member #2,030
March 2002
avatar

Quote:

I am trying to load a color font (attached) using Allegro's load_font() function. It loads correctly, but I can't change the colors of the text. Is there a way to do this using 32-bit colored fonts?

No. Color fonts have their own colors. That's what separates them from monochrome fonts.

Quote:

Is there a way to do this using 32-bit colored fonts? I am asking, because I want to have a colored outline on the font, but be able to change the inside color of the font.

Use two fonts: one for the outline and one for the inside.

--
Move to the Democratic People's Republic of Vivendi Universal (formerly known as Sweden) - officially democracy- and privacy-free since 2008-06-18!

Evert
Member #794
November 2000
avatar

Quote:

It loads correctly, but I can't change the colors of the text. Is there a way to do this using 32-bit colored fonts?

No, but you can use an 8 bit colour font and change the palette.

Quote:

I am asking, because I want to have a colored outline on the font, but be able to change the inside color of the font.

Again, this is easy if your font is 8 bit and you manipulate the palette.

LordHolNapul
Member #3,619
June 2003
avatar

I don't understand you at all....
to change the color do as I say :

      /* Important texts go in the middle. */
      width = text_length("GAME OVER");
      textout_centre_ex(screen, font, "GAME OVER",
                        SCREEN_W / 2, SCREEN_H / 2,
                        makecol32(255, 0, 0), makecol(0, 0, 0));

I use 32 bit color in my game and I can change the color of a single letter at maximum. In my game for example there is a 'Matrix' style text flow...
Are you trying to put more colors upon a single letter ? ???
Make a Bitmap an create an handling class... yeah, if this is the problem.

Evert
Member #794
November 2000
avatar

Quote:

Are you trying to put more colors upon a single letter ? ???
Make a Bitmap an create an handling class...

Why? Allegro can deal with coloured fonts just fine.

Go to: