Color Fonts in allegro...
Don Freeman

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

gnolam
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.

Evert
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

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
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.

Thread #583797. Printed from Allegro.cc