Jump to content
  • Advertisement
Sign in to follow this  
Scribe

Blending Text and Colours

This topic is 4891 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!