Blending Text and Colours

Started by
1 comment, last by Scribe 18 years, 9 months ago
Hi guys, i've recently got a text lib to place letters/numbers in ogl textures with the ability to set alpha values to certain colours. I have been trying get fonts to display in different colours without having to load extra textures, as this would be silly if i wanted every colour under the moon. I had the idea to place a colour underneath the font, and make the letter transparent. This works but only if i have a white (or single colour) background. Sadly in most cases i will have another image under the text that i want to show around the boreders of the letters, but instead the colour im putting underneath the letter is blocking the image from showing. Is there anyway i could get the letter to show in any colour i want using this or a method that doesnt require me to load new textures, and that still allows the picture behind my text to show pefectly. Thanks guys.
Advertisement
Well, if you have texture env mode set to modulate (which is the default, and can also be set by glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_MODULATE)) the texture color will be multiplied by the vertex color (glColor* etc.). So if the texture has white letters, and you set vertex color to red, you will get red letters.
That was the question, right?
That did the trick, thanks a lot.

This topic is closed to new replies.

Advertisement